@@ -42,7 +42,12 @@ first, when you are on release < R6).
42
42
` ` ` bash
43
43
kubectl patch secret -n ${CLUSTER_NAME} ${CLUSTER_NAME} -cloud-config -p ' {"stringData":{"cloudName":"' " ${PREFIX} -${CLUSTER_NAME} " ' "}}'
44
44
` ` `
45
- 5. Create Cluster Stack:
45
+ 5. Upgrade CAPI/CAPO:
46
+ ` ` ` bash
47
+ export CLUSTER_TOPOLOGY=true
48
+ clusterctl upgrade apply --infrastructure capo-system/openstack:v0.10.4 --core capi-system/cluster-api:v1.8.1 -b capi-kubeadm-bootstrap-system/kubeadm:v1.8.1 -c capi-kubeadm-control-plane-system/kubeadm:v1.8.1
49
+ ` ` `
50
+ 6. Create Cluster Stack:
46
51
` ` ` bash
47
52
kubectl -n ${CLUSTER_NAME} apply -f - << EOF
48
53
apiVersion: clusterstack.x-k8s.io/v1alpha1
@@ -60,7 +65,7 @@ first, when you are on release < R6).
60
65
kind: OpenStackClusterStackReleaseTemplate
61
66
name: cspotemplate
62
67
versions:
63
- - v1
68
+ - v2
64
69
---
65
70
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
66
71
kind: OpenStackClusterStackReleaseTemplate
@@ -76,10 +81,15 @@ first, when you are on release < R6).
76
81
` ` `
77
82
` ` ` bash
78
83
$ kubectl -n ${CLUSTER_NAME} get clusterstack
79
- NAME PROVIDER CLUSTERSTACK K8S CHANNEL AUTOSUBSCRIBE USABLE LATEST AGE REASON MESSAGE
80
- scs openstack scs 1.28 stable false v1 openstack-scs-1-28-v1 | v1.28.7 15m
84
+ NAME PROVIDER CLUSTERSTACK K8S CHANNEL AUTOSUBSCRIBE USABLE LATEST AGE REASON MESSAGE
85
+ scs openstack scs 1.28 stable false v2 openstack-scs-1-28-v2 | v1.28.11 15m
86
+ ` ` `
87
+ 7. Hack CAPO validation for updating the OpenStackCluster (remove UPDATE operation from ValidatingWebhookConfiguration):
88
+ ` ` ` bash
89
+ kubectl patch ValidatingWebhookConfiguration/capo-validating-webhook-configuration --type='json' -p='[{"op": "replace", "path": "/webhooks/0/rules/0/operations", "value":["CREATE"]}]'
81
90
` ` `
82
- 6. Migrate Cluster to KaaS v2:
91
+ 8. Migrate Cluster to KaaS v2:
92
+ > Note: If you are using flavors with a disk, remove ` controller_root_disk` and ` worker_root_disk` variables
83
93
` ` ` bash
84
94
cat << "EOF" | clusterctl generate yaml --config ~/${CLUSTER_NAME} /clusterctl.yaml | kubectl -n ${CLUSTER_NAME} apply -f -
85
95
apiVersion: cluster.x-k8s.io/v1beta1
@@ -121,27 +131,39 @@ first, when you are on release < R6).
121
131
value: ${OPENSTACK_SRVGRP_WORKER}
122
132
- name: ssh_key
123
133
value: ${OPENSTACK_SSH_KEY_NAME}
124
- class: openstack-scs-1-28-v1
134
+ class: openstack-scs-1-28-v2
125
135
version: ${KUBERNETES_VERSION}
126
136
controlPlane:
127
137
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
128
138
workers:
129
139
machineDeployments:
130
- - class: openstack-scs-1-28-v1-md-0-no1
140
+ - class: default-worker
131
141
name: "${PREFIX} -${CLUSTER_NAME} -md-0-no1"
132
142
replicas: ${WORKER_MACHINE_COUNT}
133
143
failureDomain: ${OPENSTACK_FAILURE_DOMAIN}
134
144
EOF
135
145
` ` `
136
- > Note: If you are using flavors with a disk, comment ` controller_root_disk` and ` worker_root_disk` variables
137
- 7. Fix metrics-server Cluster Addon:
146
+ 9. Add back CAPO validation for updating the OpenStackCluster (add UPDATE operation to ValidatingWebhookConfiguration):
138
147
` ` ` bash
139
- $ kubectl -n ${CLUSTER_NAME} get clusteraddon
140
- NAME CLUSTER READY AGE REASON MESSAGE
141
- cluster-addon-testcluster testcluster false 20m FailedToApplyObjects failed to successfully apply everything
142
- $ KUBECONFIG=~/${CLUSTER_NAME} /${CLUSTER_NAME} .yaml kubectl delete deployment -n kube-system metrics-server
143
- deployment.apps "metrics-server" deleted
144
- $ kubectl -n ${CLUSTER_NAME} get clusteraddon
145
- NAME CLUSTER READY AGE REASON MESSAGE
146
- cluster-addon-testcluster testcluster true 25m
148
+ kubectl patch ValidatingWebhookConfiguration/capo-validating-webhook-configuration --type='json' -p='[{"op": "replace", "path": "/webhooks/0/rules/0/operations", "value":["CREATE", "UPDATE"]}]'
147
149
` ` `
150
+ 10. Fix Cluster Addons:
151
+ ` ` ` bash
152
+ $ kubectl -n ${CLUSTER_NAME} get clusteraddon
153
+ NAME CLUSTER READY AGE REASON MESSAGE
154
+ cluster-addon-testcluster testcluster false 20m FailedToApplyObjects failed to successfully apply everything
155
+ # cannot update due to label selector changes - we can only delete old ones
156
+ $ KUBECONFIG=~/${CLUSTER_NAME} /${CLUSTER_NAME} .yaml kubectl delete deployment -n kube-system metrics-server
157
+ deployment.apps "metrics-server" deleted
158
+ $ KUBECONFIG=~/${CLUSTER_NAME} /${CLUSTER_NAME} .yaml kubectl delete daemonset -n kube-system openstack-cloud-controller-manager
159
+ daemonset.apps "openstack-cloud-controller-manager" deleted
160
+ $ kubectl -n ${CLUSTER_NAME} get clusteraddon
161
+ NAME CLUSTER READY AGE REASON MESSAGE
162
+ cluster-addon-testcluster testcluster true 25m
163
+ # names of csi-cinder-controller/nodeplugin changed to openstack-cinder-csi-controller/nodeplugin
164
+ # now we have duplicates which should be deleted
165
+ $ KUBECONFIG=~/${CLUSTER_NAME} /${CLUSTER_NAME} .yaml kubectl delete deployment -n kube-system csi-cinder-controllerplugin
166
+ deployment.apps "csi-cinder-controllerplugin" deleted
167
+ $ KUBECONFIG=~/${CLUSTER_NAME} /${CLUSTER_NAME} .yaml kubectl delete daemonset -n kube-system csi-cinder-nodeplugin
168
+ daemonset.apps "csi-cinder-nodeplugin" deleted
169
+ ` ` `
0 commit comments