remche / terraform-openstack-rke2

Deploy Kubernetes on OpenStack with RKE2
Mozilla Public License 2.0
48 stars 29 forks source link

document how upgrades work #44

Closed dhrp closed 2 years ago

dhrp commented 2 years ago

This project is great;

Now we're trying to do some upgrades. Before applying it to your production cluster I'm trying to see how it works, but there is virtually no information about how it works; besides that there is a flag "do_upgrade"

Setting the flag did trigger a remote shell execution on the server

Provisioning with 'local-exec'.
(local-exec): Executing: ["/bin/sh" "-c" "touch ./.terraform/tmp/rke2/upgrade-a25fdd70-8f4d-4b2e-8336-b0cb75389ab0-"]

but it does not appear to have done much.

The best that I have is to upgrade a 6 weeks old cluster (test) cluster with 1.24.4+rke2r1 I expect it to move to v1.24.7+rke2r1 (which is the version of a cluster that is a couple of days old)

dhrp commented 2 years ago

Oh, and I found this file .terraform/tmp/rke2/a25fdd70-8f4d-4b2e-8336-b0cb75389ab0- locally, but the file is empty

remche commented 2 years ago

I agree that upgrade mechanism is not really much (not at all...) documented, probably because it's a bit hacky and we don't use it much.

I just tested it though and it went well. To trigger the upgrade, you need the both do_upgrade and rke2_version to be set.

FYI, the code is here : https://github.com/remche/terraform-openstack-rke2/blob/master/modules/node/main.tf#L97 and the script here : https://github.com/remche/terraform-openstack-rke2/blob/master/modules/node/files/cloud-init.yml.tpl#L10

I will update the doc if you confirm it's working for you.

dhrp commented 2 years ago

Thanks! I actually also figured it out a bit later and found it works well. I tried an upgrade and a downgrade.

And I think all these versions / combinations are supported: https://github.com/rancher/rke2/tags

remche commented 2 years ago

For the CLI fans : gh release -R rancher/rke2 list