Skip to content

Commit 62c806b

Browse files
committed
Implement waiting for cluster.
Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent 8722c34 commit 62c806b

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

08-wait-cluster.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ else
1111
fi
1212
# Read settings -- make sure you can trust it
1313
source "$SET"
14-
# ToDo: Wait for cluster
15-
echo "The cluster should exist now"
16-
echo "WARN: Waiting not yet implemented"
17-
set -x
18-
clusterctl describe cluster -n "$CS_NAMESPACE" $CL_NAME
19-
echo "clusterctl get kubeconfig -n $CS_NAMESPACE $CL_NAME > ~/.kube/config-$CS_NAMESPACE.$CL_NAME"
14+
kubectl get cluster -A
15+
#set -x
16+
kubectl wait --timeout=14m --for=condition=certificatesavailable -n "$CS_NAMESPACE" kubeadmcontrolplanes -l cluster.x-k8s.io/cluster-name=$CL_NAME
17+
kubectl get -n "$CS_NAMESPACE" cluster $CL_NAME
18+
clusterctl describe cluster -n "$CS_NAMESPACE" $CL_NAME --grouping=false
19+
KCFG=~/.kube/$CS_NAMESPACE.$CL_NAME
20+
clusterctl get kubeconfig -n "$CS_NAMESPACE" $CL_NAME > $KCFG
21+
KUBECONFIG=$KCFG kubectl get nodes -o wide
22+
KUBECONFIG=$KCFG kubectl get pods -A
23+
echo "# Hint: Use KUBECONFIG=$KCFG kubectl ... to access you workload cluster $CS_NAMESPACE/$CL_NAME"

18-delete-kind.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -e
3+
kind delete cluster
4+
docker network rm kind

0 commit comments

Comments
 (0)