Skip to content

Commit 58c2e84

Browse files
authored
Update KaaS 'v1->v2' upgrade guide (#746)
Signed-off-by: Roman Hros <[email protected]>
1 parent e9bfa0e commit 58c2e84

File tree

3 files changed

+146
-101
lines changed

3 files changed

+146
-101
lines changed

doc/usage/migrate-to-kaas-v2.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ first, when you are on release < R6).
4242
```bash
4343
kubectl patch secret -n ${CLUSTER_NAME} ${CLUSTER_NAME}-cloud-config -p '{"stringData":{"cloudName":"'"${PREFIX}-${CLUSTER_NAME}"'"}}'
4444
```
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:
4651
```bash
4752
kubectl -n ${CLUSTER_NAME} apply -f - <<EOF
4853
apiVersion: clusterstack.x-k8s.io/v1alpha1
@@ -60,7 +65,7 @@ first, when you are on release < R6).
6065
kind: OpenStackClusterStackReleaseTemplate
6166
name: cspotemplate
6267
versions:
63-
- v1
68+
- v2
6469
---
6570
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
6671
kind: OpenStackClusterStackReleaseTemplate
@@ -76,10 +81,15 @@ first, when you are on release < R6).
7681
```
7782
```bash
7883
$ 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"]}]'
8190
```
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
8393
```bash
8494
cat << "EOF" | clusterctl generate yaml --config ~/${CLUSTER_NAME}/clusterctl.yaml | kubectl -n ${CLUSTER_NAME} apply -f -
8595
apiVersion: cluster.x-k8s.io/v1beta1
@@ -121,27 +131,39 @@ first, when you are on release < R6).
121131
value: ${OPENSTACK_SRVGRP_WORKER}
122132
- name: ssh_key
123133
value: ${OPENSTACK_SSH_KEY_NAME}
124-
class: openstack-scs-1-28-v1
134+
class: openstack-scs-1-28-v2
125135
version: ${KUBERNETES_VERSION}
126136
controlPlane:
127137
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
128138
workers:
129139
machineDeployments:
130-
- class: openstack-scs-1-28-v1-md-0-no1
140+
- class: default-worker
131141
name: "${PREFIX}-${CLUSTER_NAME}-md-0-no1"
132142
replicas: ${WORKER_MACHINE_COUNT}
133143
failureDomain: ${OPENSTACK_FAILURE_DOMAIN}
134144
EOF
135145
```
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):
138147
```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"]}]'
147149
```
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

Comments
 (0)