mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2026-07-26 18:38:14 +00:00
Fix rancher-lb LoadBalancer wait-loop in RKE2 scripts
The wait-loop was missing '-o' before the jsonpath template, so
'jsonpath={...}' was parsed as a service name and the query errored
to empty output, causing the loop to never wait. It also queried
.status.conditions[Pending], a shape Services do not have.
Poll the rancher-lb service and block until MetalLB assigns an
external IP instead.
This commit is contained in:
@@ -238,7 +238,7 @@ kubectl -n cattle-system get deploy rancher
|
||||
# Add Rancher LoadBalancer
|
||||
kubectl get svc -n cattle-system
|
||||
kubectl expose deployment rancher --name=rancher-lb --port=443 --type=LoadBalancer -n cattle-system
|
||||
while [[ $(kubectl get svc -n cattle-system 'jsonpath={..status.conditions[?(@.type=="Pending")].status}') = "True" ]]; do
|
||||
while [[ -z $(kubectl get svc rancher-lb -n cattle-system -o 'jsonpath={.status.loadBalancer.ingress[0].ip}' 2>/dev/null) ]]; do
|
||||
sleep 5
|
||||
echo -e " \033[32;5mWaiting for LoadBalancer to come online\033[0m"
|
||||
done
|
||||
|
||||
@@ -256,7 +256,7 @@ kubectl -n cattle-system get deploy rancher
|
||||
# Add Rancher LoadBalancer
|
||||
kubectl get svc -n cattle-system
|
||||
kubectl expose deployment rancher --name=rancher-lb --port=443 --type=LoadBalancer -n cattle-system
|
||||
while [[ $(kubectl get svc -n cattle-system 'jsonpath={..status.conditions[?(@.type=="Pending")].status}') = "True" ]]; do
|
||||
while [[ -z $(kubectl get svc rancher-lb -n cattle-system -o 'jsonpath={.status.loadBalancer.ingress[0].ip}' 2>/dev/null) ]]; do
|
||||
sleep 5
|
||||
echo -e " \033[32;5mWaiting for LoadBalancer to come online\033[0m"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user