fix: remove MetalLB setup stage — rely on pre-installed MetalLB
MetalLB is already installed and configured on the cluster. The pipeline no longer needs to apply IPAddressPool or L2Advertisement resources. Removed the 'Setup MetalLB' stage and deleted the metallb overlay files. The frontend Service type: LoadBalancer is already set, so MetalLB will automatically assign an external IP on deployment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
@@ -110,35 +110,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Setup MetalLB') {
|
||||
steps {
|
||||
withKubeConfig([credentialsId: "${K8S_CRED_ID}"]) {
|
||||
sh """
|
||||
# MetalLB is already installed on this cluster.
|
||||
# Wait for the controller to be ready — the webhook runs inside it.
|
||||
kubectl rollout status deployment/controller -n metallb-system --timeout=120s
|
||||
|
||||
# If the webhook service has no ready endpoints (e.g. stale ClusterIP
|
||||
# from a previously applied metallb-native.yaml whose pods were removed),
|
||||
# delete the broken ValidatingWebhookConfiguration so the apply can
|
||||
# proceed without being blocked by an unreachable webhook.
|
||||
READY_ADDRS=\$(kubectl get endpoints metallb-webhook-service \\
|
||||
-n metallb-system \\
|
||||
-o jsonpath='{.subsets[*].addresses[*].ip}' 2>/dev/null || echo "")
|
||||
if [ -z "\$READY_ADDRS" ]; then
|
||||
echo "WARNING: metallb-webhook-service has no ready endpoints — removing stale webhook config."
|
||||
kubectl delete validatingwebhookconfiguration metallb-webhook-configuration 2>/dev/null || true
|
||||
fi
|
||||
|
||||
kubectl apply -f k8s/overlays/on-premise/metallb/
|
||||
|
||||
echo "MetalLB pod state:"
|
||||
kubectl get pods -n metallb-system -o wide
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to K8s') {
|
||||
steps {
|
||||
withKubeConfig([credentialsId: "${K8S_CRED_ID}"]) {
|
||||
|
||||
Reference in New Issue
Block a user