Skip to content

Commit 6e9ab9e

Browse files
authored
Merge pull request #14 from SovereignCloudStack/feat/implement-wait
Feat/implement wait
2 parents f8ba2c2 + 3063591 commit 6e9ab9e

7 files changed

Lines changed: 39 additions & 14 deletions

01-kind-cluster.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ if test "$(kind get clusters)" != "kind"; then
1717
else
1818
echo "kind cluster already running"
1919
fi
20+
kubectl cluster-info

03-deploy-cso.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ EOF
2626
helm upgrade -i cso -n cso-system \
2727
--create-namespace --values ~/tmp/cso-rbac.yaml \
2828
oci://registry.scs.community/cluster-stacks/cso
29+
kubectl -n cso-system rollout status deployment

06-wait-clusterclass.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ else
1212
fi
1313
# Read settings -- make sure you can trust it
1414
source "$SET"
15-
# ToDo: Wait for cluster class
16-
echo "The clusterclass should exist now"
17-
echo "WARN: Waiting not yet implemented"
18-
sleep 3
19-
set -x
20-
kubectl get images -n "$CS_NAMESPACE"
15+
kubectl wait -n "$CS_NAMESPACE" clusterclass openstack-scs-${CS_MAINVER/./-}-${CS_VERSION} --for create
2116
kubectl get clusterclasses -n "$CS_NAMESPACE"
17+
kubectl get images -n "$CS_NAMESPACE"
18+
kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} --for condition=ready

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"

16-cleanup-cluster.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
# Create 16-cleanup-cluster.sh script
4+
echo "Cleaning cluster not yet implemented."
5+
echo "Hint: Please delete Loadbalancers and persistent volumes before deleting cluster."
6+

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

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ copy, fill it in, and pass it to the scripts.
2525
* 02-deploy-capi.sh: Install ORC and CAPI.
2626
* 03-deploy-cso.sh: Install the Cluster Stack Operator.
2727

28+
* 18-delete-kind.sh: Remove kind cluster management again.
29+
2830
### Once per OpenStack Project in which we want to install clusters (NS)
2931
* 04-cloud-secret.sh: Create namespace and secrets to work with the
3032
wanted OpenStack project.
@@ -33,13 +35,14 @@ copy, fill it in, and pass it to the scripts.
3335
* 05-deploy-cstack.sh: Create the Cluster Stack which is a template
3436
for various clusters with the same major minor version of k8s.
3537
Should trigger cluster class creation and image registration.
36-
* 06-wait-clusterclass.sh: Wait for the cluster class (not yet implemented)
38+
* 06-wait-clusterclass.sh: Wait for the cluster class
3739

3840
### Once per cluster
3941
* 07-create-cluster.sh: Create a workload cluster as per all the settings
4042
that are passed.
41-
* 08-wait-cluster.sh: Wait for the workload cluster (not yet implemented)
43+
* 08-wait-cluster.sh: Wait for the workload cluster
4244

45+
* 16-cleanup-cluster.sh: Remove loadbalancers and persistent volumes from cluster.
4346
* 17-delete-cluster.sh: Remove cluster again.
4447

4548
### CSI Cinder fixup
@@ -53,3 +56,12 @@ to a non-existing file, see [ClusterStacks issue #188](https://github.com/Sovere
5356
This results in a `CrashLoopBackup` state for
5457
the openstack-cinder-csi-* pods in the workload cluster. Until this
5558
is fixed up upstream, it can be patched using the `09-fixup-cinder.sh`.
59+
60+
### Moving management to a new cluster
61+
The bootstrap KinD management cluster (host) is not set up in a way
62+
that is robust enough for long-term operation. So we should move the
63+
CAPI, CAPO, CSO management objects into a more resilient k8s cluster,
64+
as is supported with `clusterctl move`. Beyond the capi, capi resources,
65+
this requires tracking all other management resources (objects from
66+
ORC, CSO etc.) -- once this is complete, a script will be offered
67+
to facilitate this.

0 commit comments

Comments
 (0)