From d067dbfc4498d290c17d27864332baee148f1d8c Mon Sep 17 00:00:00 2001 From: tusuii Date: Sat, 28 Feb 2026 00:31:01 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20stop=20reinstalling=20MetalLB=20?= =?UTF-8?q?=E2=80=94=20cluster=20already=20has=20it=20running?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MetalLB was already installed (metallb-speaker-* / metallb-controller-*) 32 days ago. Applying metallb-native.yaml created duplicate controller and speaker resources. The new speaker pods could not schedule because the existing metallb-speaker-* pods already occupy the host ports (7472, 7946) on all 3 nodes: "1 node(s) didn't have free ports for the requested pod ports" Fix: remove the kubectl apply for metallb-native.yaml — just apply the IPAddressPool and L2Advertisement configs which is all we need. Manual cluster cleanup required (one-time): kubectl delete deployment controller -n metallb-system kubectl delete daemonset speaker -n metallb-system Co-Authored-By: Claude Sonnet 4.6 --- Jenkinsfile | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e3a6443..52e3bb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,25 +114,11 @@ pipeline { steps { withKubeConfig([credentialsId: "${K8S_CRED_ID}"]) { sh """ - # Install MetalLB if not already present (idempotent) - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml - - # Controller must be ready before applying CRDs - kubectl rollout status deployment/controller -n metallb-system --timeout=120s - - # Speaker runs on every node as a DaemonSet. - # On CPU-constrained clusters it may be slow — don't fail the - # pipeline, just print status so we can diagnose if needed. - kubectl rollout status daemonset/speaker -n metallb-system --timeout=180s || { - echo "WARNING: MetalLB speaker rollout not complete — printing diagnostics" - kubectl get pods -n metallb-system -o wide - kubectl describe pods -l component=speaker -n metallb-system | grep -A 10 Events - } - - # Apply IP pool and L2Advertisement (idempotent) + # MetalLB is already installed on this cluster (metallb-speaker-* + # and metallb-controller-* pods). Just apply the IP pool config. kubectl apply -f k8s/overlays/on-premise/metallb/ - echo "MetalLB setup done. Current pod state:" + echo "MetalLB pod state:" kubectl get pods -n metallb-system -o wide """ }