Skip to content

Commit a746609

Browse files
Update 'R5->R6' upgrade guide (#745)
Signed-off-by: Roman Hros <roman.hros@dnation.cloud> Co-authored-by: Matej Feder <matej.feder@dnation.cloud>
1 parent 58c2e84 commit a746609

File tree

1 file changed

+53
-41
lines changed

1 file changed

+53
-41
lines changed

doc/Upgrade-Guide.md

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ into the `k8s-cluster-api-provider` directory. Note that the checked out
9191
branch will be the one that has been used when creating the management host,
9292
and you might want to change branches from `maintained/v3.x` to `maintained/v4.x`
9393
in case of R2 to R3 upgrade, `maintained/v5.x` for R3 to R4 upgrade, `maintained/v6.x`
94-
for R4 to R5 upgrade or `maintained/v7.x` for R5 to R6 upgrade.
94+
for R4 to R5 upgrade or the tag `v7.0.0` for R5 to R6 upgrade.
9595
Use `git branch -rl` to see available branches in the k8s-cluster-api-provider
9696
repository.
9797

98-
You can update the scripts and templates by checking out the relevant branch
99-
`main`, `maintained/v4.x`, `maintained/v5.x`, `maintained/v6.x` or `maintained/v7.x`
98+
You can update the scripts and templates by checking out the relevant branch/tag
99+
`main`, `maintained/v4.x`, `maintained/v5.x`, `maintained/v6.x` or `v7.0.0`
100100
and using a `git pull` to ensure the latest content is retrieved.
101101
Once you do that, the cluster-management scripts will be up-to-date.
102102
(The `~/bin` directory in your search `PATH` is symlinked to the check-ed out scripts.)
@@ -140,11 +140,9 @@ You can then upgrade the components:
140140

141141
1. `export CLUSTER_TOPOLOGY=true` - this is needed from R5 to R6 upgrade due to ClusterClass feature #600
142142
2. Upgrade components
143-
- You can do them one-by-one, e.g.:
144-
```bash
145-
clusterctl upgrade apply --infrastructure capo-system/openstack:v0.9.0 --core capi-system/cluster-api:v1.6.2 -b capi-kubeadm-bootstrap-system/kubeadm:v1.6.2 -c capi-kubeadm-control-plane-system/kubeadm:v1.6.2
146-
```
147-
- Or simply do `clusterctl upgrade apply --contract v1beta1`
143+
```bash
144+
clusterctl upgrade apply --infrastructure capo-system/openstack:v0.9.0 --core capi-system/cluster-api:v1.6.2 -b capi-kubeadm-bootstrap-system/kubeadm:v1.6.2 -c capi-kubeadm-control-plane-system/kubeadm:v1.6.2
145+
```
148146

149147
#### New templates
150148

@@ -220,7 +218,13 @@ You can use script `update-R4-to-R5.sh` to update the cluster's `cluster-templat
220218
R4 to R5. This script could update an existing Kubernetes cluster configuration files
221219
as well as `cluster-defaults` files that could be used for spawning new R5 clusters.
222220

223-
If you want to update an existing cluster configuration files from R4 to R5, just use script as follows:
221+
> Note: If you didn't change `cluster-template.yaml` or `clusterctl.yaml` before, the script should work
222+
> without any problems. If you customized these files (e.g. when you are upgrading from the main branch, instead of maintained/v5.x),
223+
> you should review the [script](https://github.com/SovereignCloudStack/k8s-cluster-api-provider/blob/main/terraform/files/bin/update-R4-to-R5.sh)
224+
> and apply necessary changes manually. E.g. use `git diff ~/${CLUSTER_NAME}/cluster-template.yaml ~/k8s-cluster-api-provider/terraform/files/template/cluster-template.yaml`,
225+
> revisit changes between releases and your customizations and apply them.
226+
227+
If you want to update an existing cluster configuration files from R4 to R5, just use script as follows (backup recommended):
224228
```bash
225229
update-R4-to-R5.sh <CLUSTER_NAME>
226230
```
@@ -251,7 +255,13 @@ You can use script `update-R5-to-R6.sh` to update the cluster's `cluster-templat
251255
R5 to R6. This script could update an existing Kubernetes cluster configuration files
252256
as well as `cluster-defaults` files that could be used for spawning new R6 clusters.
253257

254-
If you want to update an existing cluster configuration files from R5 to R6, just use script as follows:
258+
> Note: If you didn't change `cluster-template.yaml` or `clusterctl.yaml` before, the script should work
259+
> without any problems. If you customized these files (e.g. when you are upgrading from the main branch, instead of maintained/v6.x),
260+
> you should review the [script](https://github.com/SovereignCloudStack/k8s-cluster-api-provider/blob/main/terraform/files/bin/update-R5-to-R6.sh)
261+
> and apply necessary changes manually. E.g. use `git diff ~/${CLUSTER_NAME}/cluster-template.yaml ~/k8s-cluster-api-provider/terraform/files/template/cluster-template.yaml`,
262+
> revisit changes between releases and your customizations and apply them.
263+
264+
If you want to update an existing cluster configuration files from R5 to R6, just use script as follows (backup recommended):
255265
```bash
256266
update-R5-to-R6.sh <CLUSTER_NAME>
257267
```
@@ -371,54 +381,55 @@ If you decide to migrate your existing Kubernetes cluster from R4 to R5 be aware
371381

372382
Follow the below steps if you want to migrate an existing cluster from R4 to R5:
373383
1. Access your management node
374-
2. Checkout R5 branch
384+
2. Make sure there are no changes waiting to be applied (`create_cluster.sh <CLUSTER_NAME>`)
385+
3. Checkout R5 branch
375386
```bash
376387
cd k8s-cluster-api-provider
377388
git pull
378389
git checkout maintained/v6.x
379390
```
380-
3. Backup an existing cluster configuration files (recommended)
391+
4. Backup an existing cluster configuration files (recommended)
381392
```bash
382393
cd ..
383394
cp -R <CLUSTER_NAME> <CLUSTER_NAME>-backup
384395
```
385-
4. Update an existing cluster configuration files from R4 to R5
396+
5. Update an existing cluster configuration files from R4 to R5, see [related](#r4-to-r5) section for details before
386397
```bash
387398
update-R4-to-R5.sh <CLUSTER_NAME>
388399
```
389-
5. Validate updated cluster configuration files. You will find that e.g. Calico version
400+
6. Validate updated cluster configuration files. You will find that e.g. Calico version
390401
has been bumped from v3.25.0 to v3.26.1. Note that some software versions are not configurable
391402
and are not directly mentioned in the cluster configuration files, but they are hardcoded
392403
in R5 scripts (e.g. ingress nginx controller, metrics server). Hence, read carefully the
393404
R5 release notes too. Also see that Kubernetes version was not updated, and it is still v1.25.6.
394-
6. Update an existing cluster (except Kubernetes version)
405+
7. Update an existing cluster (except Kubernetes version)
395406
```bash
396407
create_cluster.sh <CLUSTER_NAME>
397408
```
398-
7. Update cluster-API and openstack cluster-API provider, see [related](#updating-cluster-api-and-openstack-cluster-api-provider) section for details
409+
8. Update cluster-API and openstack cluster-API provider, see [related](#updating-cluster-api-and-openstack-cluster-api-provider) section for details
399410
```bash
400411
clusterctl upgrade plan
401-
clusterctl upgrade apply --contract v1beta1
412+
clusterctl upgrade apply --infrastructure capo-system/openstack:v0.7.3 --core capi-system/cluster-api:v1.5.1 -b capi-kubeadm-bootstrap-system/kubeadm:v1.5.1 -c capi-kubeadm-control-plane-system/kubeadm:v1.5.1
402413
```
403-
8. Bump Kubernetes version +1 minor release (to v1.26.8) and increase the generation counter for node and control plane nodes
414+
9. Bump Kubernetes version +1 minor release (to v1.26.8) and increase the generation counter for node and control plane nodes
404415
```bash
405416
sed -i 's/^KUBERNETES_VERSION: v1.25.6/KUBERNETES_VERSION: v1.26.8/' <CLUSTER_NAME>/clusterctl.yaml
406417
sed -i 's/^OPENSTACK_IMAGE_NAME: ubuntu-capi-image-v1.25.6/OPENSTACK_IMAGE_NAME: ubuntu-capi-image-v1.26.8/' <CLUSTER_NAME>/clusterctl.yaml
407418
sed -r 's/(^CONTROL_PLANE_MACHINE_GEN: genc)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
408419
sed -r 's/(^WORKER_MACHINE_GEN: genw)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
409420
```
410-
9. Update an existing cluster Kubernetes version to v1.26.8
411-
```bash
412-
create_cluster.sh <CLUSTER_NAME>
413-
```
414-
10. Bump Kubernetes version to R5 v1.27.5 and increase the generation counter for node and control plane nodes
421+
10. Update an existing cluster Kubernetes version to v1.26.8
422+
```bash
423+
create_cluster.sh <CLUSTER_NAME>
424+
```
425+
11. Bump Kubernetes version to R5 v1.27.5 and increase the generation counter for node and control plane nodes
415426
```bash
416427
sed -i 's/^KUBERNETES_VERSION: v1.26.8/KUBERNETES_VERSION: v1.27.5/' <CLUSTER_NAME>/clusterctl.yaml
417428
sed -i 's/^OPENSTACK_IMAGE_NAME: ubuntu-capi-image-v1.26.8/OPENSTACK_IMAGE_NAME: ubuntu-capi-image-v1.27.5/' <CLUSTER_NAME>/clusterctl.yaml
418429
sed -r 's/(^CONTROL_PLANE_MACHINE_GEN: genc)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
419430
sed -r 's/(^WORKER_MACHINE_GEN: genw)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
420431
```
421-
11. Update an existing cluster to the R5 Kubernetes version v1.27.5
432+
12. Update an existing cluster to the R5 Kubernetes version v1.27.5
422433
```bash
423434
create_cluster.sh <CLUSTER_NAME>
424435
```
@@ -432,49 +443,50 @@ If you decide to migrate your existing Kubernetes cluster from R5 to R6 be aware
432443

433444
Follow the below steps if you want to migrate an existing cluster from R5 to R6:
434445
1. Access your management node
435-
2. Checkout R6 branch
446+
2. Make sure there are no changes waiting to be applied (`create_cluster.sh <CLUSTER_NAME>`)
447+
3. Checkout R6 release
436448
```bash
437449
cd k8s-cluster-api-provider
438450
git pull
439-
git checkout maintained/v7.x
451+
git checkout v7.0.0
440452
```
441-
3. Backup an existing cluster configuration files (recommended)
453+
4. Backup an existing cluster configuration files (recommended)
442454
```bash
443455
cd ..
444456
cp -R <CLUSTER_NAME> <CLUSTER_NAME>-backup
445457
```
446-
4. Update an existing cluster configuration files from R5 to R6
458+
5. Update an existing cluster configuration files from R5 to R6, see [related](#r5-to-r6) section for details before
447459
```bash
448460
update-R5-to-R6.sh <CLUSTER_NAME>
449461
```
450-
5. Validate updated cluster configuration files. You will find that e.g. Calico version
462+
6. Validate updated cluster configuration files. You will find that e.g. Calico version
451463
has been bumped from v3.26.1 to v3.27.2 or Kubernetes version bumped from v1.27.5 to v1.28.7.
452464
Note that some software versions are not configurable and are not directly mentioned in the
453465
cluster configuration files, but they are hardcoded in R6 scripts (e.g. ingress nginx controller,
454466
metrics server, cilium). Hence, read carefully the R6 release notes too.
455-
6. Update cluster-API and openstack cluster-API provider, see [related](#updating-cluster-api-and-openstack-cluster-api-provider) section for details
467+
7. Update cluster-API and openstack cluster-API provider, see [related](#updating-cluster-api-and-openstack-cluster-api-provider) section for details
456468
```bash
457469
clusterctl upgrade plan
458470
export CLUSTER_TOPOLOGY=true
459-
clusterctl upgrade apply --contract v1beta1
471+
clusterctl upgrade apply --infrastructure capo-system/openstack:v0.9.0 --core capi-system/cluster-api:v1.6.2 -b capi-kubeadm-bootstrap-system/kubeadm:v1.6.2 -c capi-kubeadm-control-plane-system/kubeadm:v1.6.2
460472
```
461-
7. Migrate to ClusterClass
473+
8. Migrate to ClusterClass
462474
```bash
463475
migrate-to-cluster-class.sh <CLUSTER_NAME>
464476
```
465-
8. Increase the generation counter for worker and control plane nodes
477+
9. Increase the generation counter for worker and control plane nodes
466478
```bash
467479
sed -r 's/(^CONTROL_PLANE_MACHINE_GEN: genc)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
468480
sed -r 's/(^WORKER_MACHINE_GEN: genw)([0-9][0-9])/printf "\1%02d" $((\2+1))/ge' -i <CLUSTER_NAME>/clusterctl.yaml
469481
```
470-
9. Update an existing cluster to the R6
471-
```bash
472-
create_cluster.sh <CLUSTER_NAME>
473-
```
474-
> Note: You will probably experience a double rollout of nodes because
475-
> the k8s version and templates are changed concurrently here.
476-
> See [https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/operate-cluster#effects-of-concurrent-changes](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/operate-cluster#effects-of-concurrent-changes)
477-
10. Upgrade cilium (for clusters with `USE_CILIUM: true`)
482+
10. Update an existing cluster to the R6
483+
```bash
484+
create_cluster.sh <CLUSTER_NAME>
485+
```
486+
> Note: You will probably experience a double rollout of nodes because
487+
> the k8s version and templates are changed concurrently here.
488+
> See [https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/operate-cluster#effects-of-concurrent-changes](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/operate-cluster#effects-of-concurrent-changes)
489+
11. Upgrade cilium (for clusters with `USE_CILIUM: true`)
478490
```bash
479491
KUBECONFIG=<CLUSTER_NAME>/<CLUSTER_NAME>.yaml bash -c 'helm get values cilium -n kube-system -o yaml | cilium upgrade --version v1.15.1 -f -'
480492
```

0 commit comments

Comments
 (0)