@@ -18,8 +18,6 @@ kubectl -n capo-system rollout status deployment
1818
1919```
2020
21- values.yaml
22-
2321```
2422# Install CSO and CSPO
2523cat <<EOF | helm upgrade -i cso \
@@ -30,6 +28,13 @@ oci://registry.scs.community/cluster-stacks/cso \
3028clusterStackVariables:
3129 ociRepository: registry.scs.community/kaas/cluster-stacks
3230controllerManager:
31+ manager:
32+ extraEnv:
33+ - name: HELM_CACHE_HOME
34+ value: /tmp/downloads/cluster-stacks/.helm/cache
35+ image:
36+ repository: ghcr.io/sovereigncloudstack/cso-staging
37+ tag: sha-5b1840a
3338 rbac:
3439 additionalRules:
3540 - apiGroups:
@@ -46,20 +51,25 @@ controllerManager:
4651 - watch
4752EOF
4853```
54+
4955``` sh
50- kubectl create namespace cluster
56+ export CLUSTER_NAMESPACE=cluster
57+ export CLUSTER_NAME=my-cluster
58+ export CLUSTERSTACK_NAMESPACE=cluster
59+ export CLUSTERSTACK_VERSION=v0-sha.ksgrnrp
60+ export OS_CLIENT_CONFIG_FILE=${PWD} /clouds.yaml
61+ kubectl create namespace $CLUSTER_NAMESPACE --dry-run=client -o yaml | kubectl apply -f -
5162```
5263
5364``` sh
5465# Create secret for CAPO
55- export OS_CLIENT_CONFIG_FILE=< path to clouds.yaml>
56- kubectl create secret -n cluster generic openstack --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE
66+ kubectl create secret -n $CLUSTER_NAMESPACE generic openstack --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE
5767
5868# Prepare the Secret as it will be deployed in the Workload Cluster
5969kubectl create secret -n kube-system generic clouds-yaml --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE --dry-run=client -oyaml > clouds-yaml-secret
6070
6171# Add the Secret to the ClusterResourceSet Secret in the Management Cluster
62- kubectl create -n cluster secret generic clouds-yaml --from-file=clouds-yaml-secret --type=addons.cluster.x-k8s.io/resource-set
72+ kubectl create -n $CLUSTER_NAMESPACE secret generic clouds-yaml --from-file=clouds-yaml-secret --type=addons.cluster.x-k8s.io/resource-set
6373```
6474
6575``` yaml
@@ -68,7 +78,7 @@ apiVersion: addons.cluster.x-k8s.io/v1beta1
6878kind : ClusterResourceSet
6979metadata :
7080 name : clouds-yaml
71- namespace : cluster
81+ namespace : $CLUSTER_NAMESPACE
7282spec :
7383 strategy : " Reconcile"
7484 clusterSelector :
8191```
8292
8393``` sh
94+ # Apply ClusterStack resource
8495cat << EOF | kubectl apply -f -
8596apiVersion: clusterstack.x-k8s.io/v1alpha1
8697kind: ClusterStack
8798metadata:
8899 name: openstack
89- namespace: cluster
100+ namespace: $CLUSTERSTACK_NAMESPACE
90101spec:
91102 provider: openstack
92103 name: scs2
@@ -95,25 +106,19 @@ spec:
95106 autoSubscribe: false
96107 noProvider: true
97108 versions:
98- - v0-sha.ksgrnrp
109+ - $CLUSTERSTACK_VERSION
99110EOF
100111```
101112
102- Check if ClusterClasses exist
103-
104- ``` sh
105- kubectl get clusterclass -n cluster
106- ```
107-
108- cluster.yaml
109-
110113``` sh
114+ # Apply Cluster resource
111115cat << EOF | kubectl apply -f -
112116apiVersion: cluster.x-k8s.io/v1beta1
113117kind: Cluster
114118metadata:
115119 name: my-cluster
116- namespace: cluster
120+ namespace: $CLUSTER_NAMESPACE
121+
117122 labels:
118123 managed-secret: clouds-yaml
119124spec:
@@ -127,13 +132,8 @@ spec:
127132 - "10.96.0.0/12"
128133 topology:
129134 variables:
130- - name: apiServerLoadBalancer
131- value: octavia-ovn
132- - name: imageIsOrc
133- value: false
134- - name: controlPlaneFlavor
135- value: SCS-2V-4-20s
136- class: openstack-scs2-1-33-v0-sha.ksgrnrp
135+ class: openstack-scs2-1-33-$CLUSTERSTACK_VERSION
136+ classNamespace: $CLUSTERSTACK_NAMESPACE
137137 controlPlane:
138138 replicas: 1
139139 version: v1.33.4
146146```
147147
148148``` sh
149- clusterctl get kubeconfig -n cluster openstack-testcluster > /tmp/kubeconfig
149+ clusterctl get kubeconfig -n $CLUSTER_NAMESPACE openstack-testcluster > /tmp/kubeconfig
150150kubectl get nodes --kubeconfig /tmp/kubeconfig
151151```
0 commit comments