Skip to content

Commit 4dc84ed

Browse files
committed
Support scs2 cluster stacks series.
Signed-off-by: Kurt Garloff <kurt@garloff.de>
1 parent c06aff7 commit 4dc84ed

5 files changed

Lines changed: 21 additions & 14 deletions

File tree

05-deploy-cstack.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ source "$SET"
1616
# Sanity checks
1717
if test -z "$CS_MAINVER"; then echo "Configure CS_MAINVER"; exit 2; fi
1818
if test -z "$CS_VERSION"; then echo "Configure CS_VERSION"; exit 3; fi
19+
if test -z "$CS_SERIES"; then echo "Configure CS_SERIES, default to scs2"; CS_SERIES=scs2; fi
1920
# if test -z "$CL_PATCHVER"; then echo "Configure CL_PATCHVER"; exit 4; fi
2021
# Create ClusterStack yaml
2122
cat > ~/tmp/clusterstack-$CS_MAINVER.yaml <<EOF
@@ -26,7 +27,7 @@ metadata:
2627
namespace: "$CS_NAMESPACE"
2728
spec:
2829
provider: openstack
29-
name: scs
30+
name: "$CS_SERIES"
3031
kubernetesVersion: "$CS_MAINVER"
3132
channel: custom
3233
autoSubscribe: false

06-wait-clusterclass.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,34 @@ else
1313
fi
1414
# Read settings -- make sure you can trust it
1515
source "$SET"
16+
if test -z "$CS_SERIES"; then echo "Configure CS_SERIES, default to scs2"; CS_SERIES=scs2; fi
1617
# If we have an array, match what CS_VERSION we want to wait for
1718
if test "${CS_VERSION:0:1}" = "["; then
1819
VERSIONS="$(echo $CS_VERSION | sed -e 's/\[//' -e 's/\]//' -e 's/,/ /g')"
1920
for ver in $VERSIONS; do
20-
#echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${ver/./-} readiness"
21-
echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${ver/./-} creation"
22-
kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${ver/./-} --for create
21+
echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-${CS_SERIES}-${CS_MAINVER/./-}-${ver/./-} creation"
22+
kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-${CS_SERIES}-${CS_MAINVER/./-}-${ver/./-} --for create
2323
done
2424
VERSIONS=$(kubectl get clusterstackreleases -n $CS_NAMESPACE -o "custom-columns=NAME:.metadata.name,K8SVER:.status.kubernetesVersion")
2525
echo -e "# Table of registered clusterstackreleases:\n$VERSIONS"
2626
while read csnm k8sver; do
2727
if test "$csnm" = "NAME"; then continue; fi
2828
if test "$k8sver" = "v$CL_PATCHVER"; then
29-
CS_VERSION="v${csnm#openstack-scs-?-??-v}"
29+
CS_VERSION="v${csnm#openstack-${CS_SERIES}-?-??-v}"
3030
CS_VERSION="${CS_VERSION//-/.}"
3131
CS_VERSION="${CS_VERSION/./-}"
32+
#echo "$CS_VERSION"
3233
break
3334
fi
3435
done < <(echo "$VERSIONS")
3536
if test "${CS_VERSION:0:1}" = "["; then
3637
echo "No clusterstackrelease with v$CL_PATCHVER found"
3738
fi
3839
else
39-
echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} readiness"
40-
kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} --for condition=ready
40+
echo "Wait for clusterstackrelease -n $CS_NAMESPACE openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION/./-} readiness"
41+
kubectl wait -n "$CS_NAMESPACE" clusterstackrelease openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION/./-} --for condition=ready
4142
fi
42-
echo "# Wait for clusterclass -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-${CS_VERSION} creation"
43-
kubectl wait -n "$CS_NAMESPACE" clusterclass openstack-scs-${CS_MAINVER/./-}-${CS_VERSION} --for create
43+
echo "# Wait for clusterclass -n $CS_NAMESPACE openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION} creation"
44+
kubectl wait -n "$CS_NAMESPACE" clusterclass openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION} --for create
4445
kubectl get clusterclasses -n "$CS_NAMESPACE"
4546
kubectl get images -n "$CS_NAMESPACE"

07-cluster-secret.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ else
1313
fi
1414
# Read settings -- make sure you can trust it
1515
source "$SET"
16+
if test -z "$CS_SERIES"; then echo "Configure CS_SERIES, default to scs2"; CS_SERIES=scs2; fi
1617
# Read helper
1718
THISDIR=$(dirname 0)
1819
source "$THISDIR/_yaml_parse.sh"
@@ -37,6 +38,7 @@ else
3738
fi
3839

3940
OLD_UMASK=$(umask)
41+
CL_NAME_B64=$(echo -n openstack | base64 -w0)
4042

4143
# Deal with per-cluster secrets
4244
# A few cases:

08-create-cluster.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ source "$SET"
1414
# Sanity checks
1515
if test -z "$CS_MAINVER"; then echo "Configure CS_MAINVER"; exit 2; fi
1616
if test -z "$CS_VERSION"; then echo "Configure CS_VERSION"; exit 3; fi
17+
if test -z "$CS_SERIES"; then echo "Configure CS_SERIES, default to scs2"; CS_SERIES=scs2; fi
1718
if test -z "$CL_PATCHVER"; then echo "Configure CL_PATCHVER"; exit 4; fi
1819
if test -z "$CL_NAME"; then echo "Configure CL_NAME"; exit 5; fi
1920
if test -z "$CL_PODCIDR"; then echo "Configure CL_PODCIDR"; exit 6; fi
@@ -27,7 +28,7 @@ if test "${CS_VERSION:0:1}" = "["; then
2728
while read csnm k8sver; do
2829
if test "$csnm" = "NAME"; then continue; fi
2930
if test "$k8sver" = "v$CL_PATCHVER"; then
30-
CS_VERSION="v${csnm#openstack-scs-?-??-v}"
31+
CS_VERSION="v${csnm#openstack-${CS_SERIES}-?-??-v}"
3132
CS_VERSION="${CS_VERSION//-/.}"
3233
CS_VERSION="${CS_VERSION/./-}"
3334
break
@@ -44,8 +45,8 @@ else
4445
fi
4546
# Distinguish between old (cloud.config) and new style (clouds.yaml) secrets
4647
# This depends on the clusterstackrelease, not on whether or not we have a newsecret
47-
#if kubectl get -n $CS_NAMESPACE clusterstackreleases.clusterstack.x-k8s.io openstack-scs-${CS_MAINVER/./-}-${CS_VERSION/./-} -o jsonpath='{.status.resources}' | grep openstack-scs-${CS_MAINVER/./-}-${CS_VERSION}-clouds-yaml >/dev/null 2>&1; then
48-
CFGSTYLE=$(kubectl get clusterclasses.cluster.x-k8s.io -n $CS_NAMESPACE openstack-scs-${CS_MAINVER/./-}-$CS_VERSION -o jsonpath='{.metadata.annotations.configStyle}' || true)
48+
#if kubectl get -n $CS_NAMESPACE clusterstackreleases.clusterstack.x-k8s.io openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION/./-} -o jsonpath='{.status.resources}' | grep openstack-${CS_SERIES}-${CS_MAINVER/./-}-${CS_VERSION}-clouds-yaml >/dev/null 2>&1; then
49+
CFGSTYLE=$(kubectl get clusterclasses.cluster.x-k8s.io -n $CS_NAMESPACE openstack-${CS_SERIES}-${CS_MAINVER/./-}-$CS_VERSION -o jsonpath='{.metadata.annotations.configStyle}' || true)
4950
if test "$CFGSTYLE" = "clouds-yaml"; then
5051
MGD_SEC="managed-secret: clouds-yaml$SECRETSUFFIX"
5152
else
@@ -89,7 +90,7 @@ spec:
8990
cidrBlocks:
9091
- "$CL_SVCCIDR"
9192
topology:
92-
class: openstack-scs-${CS_MAINVER/./-}-$CS_VERSION
93+
class: openstack-${CS_SERIES}-${CS_MAINVER/./-}-$CS_VERSION
9394
controlPlane:
9495
replicas: $CL_CTRLNODES
9596
version: v$CL_PATCHVER

cluster-settings-template.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ OS_CLOUD=${OS_CLOUD:-openstack}
1717
### Per cluster stack settings
1818
# Kubernetes Maj.Min, e.g. 1.32 (without leading v), can be left empty (see last line)
1919
CS_MAINVER=
20-
# CS Template versions that matches, should be an array, e.g. [v1, v2, v0-git.XXXXXXX]
20+
# CS Template versions that match, should be an array, e.g. [v1, v2, v0-git.XXXXXXX]
2121
CS_VERSION=
22+
# CS Series (scs or scs2)
23+
CS_SERIES=scs2
2224
### Now the per workload cluster settings
2325
# Full K8s Version Maj.Min.Patch, without leading 'v', e.g. 1.32.3 (this is per cluster)
2426
CL_PATCHVER=

0 commit comments

Comments
 (0)