fix: stop reinstalling MetalLB — cluster already has it running
Some checks failed
scrum-manager/pipeline/head There was a failure building this commit
Some checks failed
scrum-manager/pipeline/head There was a failure building this commit
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 <noreply@anthropic.com>
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -114,25 +114,11 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
withKubeConfig([credentialsId: "${K8S_CRED_ID}"]) {
|
withKubeConfig([credentialsId: "${K8S_CRED_ID}"]) {
|
||||||
sh """
|
sh """
|
||||||
# Install MetalLB if not already present (idempotent)
|
# MetalLB is already installed on this cluster (metallb-speaker-*
|
||||||
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml
|
# and metallb-controller-* pods). Just apply the IP pool config.
|
||||||
|
|
||||||
# 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)
|
|
||||||
kubectl apply -f k8s/overlays/on-premise/metallb/
|
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
|
kubectl get pods -n metallb-system -o wide
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user