@@ -18,8 +18,6 @@ kubectl -n capo-system rollout status deployment
18
18
19
19
```
20
20
21
- values.yaml
22
-
23
21
```
24
22
# Install CSO and CSPO
25
23
cat <<EOF | helm upgrade -i cso \
@@ -30,6 +28,13 @@ oci://registry.scs.community/cluster-stacks/cso \
30
28
clusterStackVariables:
31
29
ociRepository: registry.scs.community/kaas/cluster-stacks
32
30
controllerManager:
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
33
38
rbac:
34
39
additionalRules:
35
40
- apiGroups:
@@ -46,20 +51,25 @@ controllerManager:
46
51
- watch
47
52
EOF
48
53
```
54
+
49
55
``` 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 -
51
62
```
52
63
53
64
``` sh
54
65
# 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
57
67
58
68
# Prepare the Secret as it will be deployed in the Workload Cluster
59
69
kubectl create secret -n kube-system generic clouds-yaml --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE --dry-run=client -oyaml > clouds-yaml-secret
60
70
61
71
# 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
63
73
```
64
74
65
75
``` yaml
@@ -68,7 +78,7 @@ apiVersion: addons.cluster.x-k8s.io/v1beta1
68
78
kind : ClusterResourceSet
69
79
metadata :
70
80
name : clouds-yaml
71
- namespace : cluster
81
+ namespace : $CLUSTER_NAMESPACE
72
82
spec :
73
83
strategy : " Reconcile"
74
84
clusterSelector :
81
91
```
82
92
83
93
``` sh
94
+ # Apply ClusterStack resource
84
95
cat << EOF | kubectl apply -f -
85
96
apiVersion: clusterstack.x-k8s.io/v1alpha1
86
97
kind: ClusterStack
87
98
metadata:
88
99
name: openstack
89
- namespace: cluster
100
+ namespace: $CLUSTERSTACK_NAMESPACE
90
101
spec:
91
102
provider: openstack
92
103
name: scs2
@@ -95,25 +106,19 @@ spec:
95
106
autoSubscribe: false
96
107
noProvider: true
97
108
versions:
98
- - v0-sha.ksgrnrp
109
+ - $CLUSTERSTACK_VERSION
99
110
EOF
100
111
```
101
112
102
- Check if ClusterClasses exist
103
-
104
- ``` sh
105
- kubectl get clusterclass -n cluster
106
- ```
107
-
108
- cluster.yaml
109
-
110
113
``` sh
114
+ # Apply Cluster resource
111
115
cat << EOF | kubectl apply -f -
112
116
apiVersion: cluster.x-k8s.io/v1beta1
113
117
kind: Cluster
114
118
metadata:
115
119
name: my-cluster
116
- namespace: cluster
120
+ namespace: $CLUSTER_NAMESPACE
121
+
117
122
labels:
118
123
managed-secret: clouds-yaml
119
124
spec:
@@ -127,13 +132,8 @@ spec:
127
132
- "10.96.0.0/12"
128
133
topology:
129
134
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
137
137
controlPlane:
138
138
replicas: 1
139
139
version: v1.33.4
146
146
```
147
147
148
148
``` sh
149
- clusterctl get kubeconfig -n cluster openstack-testcluster > /tmp/kubeconfig
149
+ clusterctl get kubeconfig -n $CLUSTER_NAMESPACE openstack-testcluster > /tmp/kubeconfig
150
150
kubectl get nodes --kubeconfig /tmp/kubeconfig
151
151
```
0 commit comments