From c13aa29df51d76054fbedc1c60a5f8205ba25db2 Mon Sep 17 00:00:00 2001
From: kpoulakakis <kpoulakakis@ubitech.eu>
Date: Fri, 20 Jun 2025 12:24:24 +0300
Subject: [PATCH] feat: add metallb configuration for telemetry service.

---
 deploy/tfs.sh                   | 11 +++++++++++
 manifests/telemetryservice.yaml |  2 +-
 my_deploy.sh                    |  5 +++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/deploy/tfs.sh b/deploy/tfs.sh
index b73bbbf81..ea6923155 100755
--- a/deploy/tfs.sh
+++ b/deploy/tfs.sh
@@ -123,6 +123,11 @@ export KFK_SERVER_PORT=${KFK_SERVER_PORT:-"9092"}
 # If not already set, if flag is YES, Apache Kafka will be redeployed and topic will be lost.
 export KFK_REDEPLOY=${KFK_REDEPLOY:-""}
 
+# ----- Telemetry Config ------------------------------------------------------
+
+# Replace LOAD_BALANCER_IP
+export LOAD_BALANCER_IP=${LOAD_BALANCER_IP:-""}
+
 ########################################################################################################################
 # Automated steps start here
 ########################################################################################################################
@@ -241,6 +246,9 @@ else
 fi
 printf "\n"
 
+# Before deployment change the telemetry LOAD_BALANCER_IP
+sed -i "s|_LOAD_BALANCER_IP_|$LOAD_BALANCER_IP|g" manifests/telemetryservice.yaml
+
 for COMPONENT in $TFS_COMPONENTS; do
     echo "Processing '$COMPONENT' component..."
 
@@ -623,6 +631,9 @@ if [[ "$TFS_COMPONENTS" == *"monitoring"* ]] && [[ "$TFS_COMPONENTS" == *"webui"
     printf "\n\n"
 fi
 
+# Revert _LOAD_BALANCER_IP_ for the next deployment
+sed -i "s|$LOAD_BALANCER_IP|_LOAD_BALANCER_IP_|g" manifests/telemetryservice.yaml
+
 echo "Pruning Docker Images..."
 docker image prune --force
 printf "\n\n"
diff --git a/manifests/telemetryservice.yaml b/manifests/telemetryservice.yaml
index 2add96516..1a8794dc7 100644
--- a/manifests/telemetryservice.yaml
+++ b/manifests/telemetryservice.yaml
@@ -95,7 +95,7 @@ metadata:
     app: telemetryservice
 spec:
   type: LoadBalancer
-  loadBalancerIP: 192.168.5.250
+  loadBalancerIP: 
   externalTrafficPolicy: Local
   selector:
     app: telemetryservice
diff --git a/my_deploy.sh b/my_deploy.sh
index 4d3820f41..7ba0c9c38 100644
--- a/my_deploy.sh
+++ b/my_deploy.sh
@@ -211,3 +211,8 @@ export KFK_SERVER_PORT="9092"
 
 # Set the flag to YES for redeploying of Apache Kafka
 export KFK_REDEPLOY=""
+
+# ----- Telemetry Config ------------------------------------------------------
+
+# Replace LOAD_BALANCER_IP
+export LOAD_BALANCER_IP="192.168.5.250"
-- 
GitLab