From 4345d5dbf6d17e163fca39ac79c550ea611b960b Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 23 Mar 2025 14:05:16 +0100 Subject: [PATCH] Refactor MetalLB config job to create temporary YAML files for IPAddressPool and L2Advertisement --- infrastructure/controllers/metallb/config-job.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/infrastructure/controllers/metallb/config-job.yaml b/infrastructure/controllers/metallb/config-job.yaml index 6b585c1..8ea6ed4 100644 --- a/infrastructure/controllers/metallb/config-job.yaml +++ b/infrastructure/controllers/metallb/config-job.yaml @@ -37,7 +37,10 @@ spec: exit 1 fi - cat < /tmp/ippool.yaml << EOF apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: @@ -45,10 +48,13 @@ spec: namespace: metallb-system spec: addresses: - - ${SERVER_IP}/32 + - "$SERVER_IP/32" EOF - cat < /tmp/l2advert.yaml << EOF apiVersion: metallb.io/v1beta1 kind: L2Advertisement metadata: @@ -59,6 +65,8 @@ spec: - first-pool EOF + kubectl apply -f /tmp/l2advert.yaml + echo "MetalLB configured to use IP: $SERVER_IP" restartPolicy: OnFailure ---