Skip to content

Commit 027ca9c

Browse files
committed
Improve the waiting for the workload cluster.
We have waited for the secrets before we get the workloadcluster KUBECONFIG. We now also wait for the control plane before asking for nodes and pods. Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent 5669769 commit 027ca9c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

08-wait-cluster.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Wait for cluster
33
set -e
44
# We need settings
5+
unset KUBECONFIG
56
if test -n "$1"; then
67
SET="$1"
78
else
@@ -11,10 +12,12 @@ else
1112
fi
1213
# Read settings -- make sure you can trust it
1314
source "$SET"
14-
kubectl get cluster -A
15+
#kubectl get cluster -A
1516
#set -x
16-
kubectl wait --timeout=14m --for=condition=certificatesavailable -n "$CS_NAMESPACE" kubeadmcontrolplanes -l cluster.x-k8s.io/cluster-name=$CL_NAME
17+
echo "# Wait for certificates for cluster -n $CS_NAMESPACE $CL_NAME"
18+
kubectl wait --timeout=12m --for=condition=certificatesavailable -n "$CS_NAMESPACE" kubeadmcontrolplanes -l cluster.x-k8s.io/cluster-name=$CL_NAME
1719
kubectl get -n "$CS_NAMESPACE" cluster $CL_NAME
20+
kubectl wait --timeout=8m --for=condition=Ready -n "$CS_NAMESPACE" machine -l cluster.x-k8s.io/control-plane,cluster.x-k8s.io/cluster-name=${CL_NAME}
1821
clusterctl describe cluster -n "$CS_NAMESPACE" $CL_NAME --grouping=false
1922
KCFG=~/.kube/$CS_NAMESPACE.$CL_NAME
2023
OLDUMASK=$(umask)

0 commit comments

Comments
 (0)