Upgrading k0rdent#
Important
When upgrading to K0rdent 0.2.0 follow this instruction and perform
additional manual steps.
Upgrading k0rdent involves making upgrades to the Management object. To do that, you must have the Global Admin role. (For detailed information about k0rdent RBAC roles and permissions, refer to the RBAC documentation.) Follow these steps to upgrade k0rdent:
-
Create a new
ReleaseobjectStart by creating a
Releaseobject in the management cluster that points to the desired version. You can see available versions at https://github.com/k0rdent/kcm/releases. The actualReleaseobject includes information on the templates and resources that are available, as well as the version of the Kubernetes Cluster API. For example, the v0.2.0Releaseobject looks like this:apiVersion: k0rdent.mirantis.com/v1alpha1 kind: Release metadata: name: kcm-0-2-0 annotations: helm.sh/resource-policy: keep spec: version: 0.2.0 kcm: template: kcm-0-2-0 capi: template: cluster-api-0-2-0 providers: - name: cluster-api-provider-k0sproject-k0smotron template: cluster-api-provider-k0sproject-k0smotron-0-2-0 - name: cluster-api-provider-azure template: cluster-api-provider-azure-0-2-0 - name: cluster-api-provider-vsphere template: cluster-api-provider-vsphere-0-2-0 - name: cluster-api-provider-aws template: cluster-api-provider-aws-0-2-0 - name: cluster-api-provider-openstack template: cluster-api-provider-openstack-0-2-0 - name: cluster-api-provider-docker template: cluster-api-provider-docker-0-2-0 - name: cluster-api-provider-gcp template: cluster-api-provider-gcp-0-2-0 - name: projectsveltos template: projectsveltos-0-0.50.0-0Thankfully, you don't have to build these YAML files yourself. Once you've chosen a release, you can go ahead and create the release object by referencing the YAML file online, as in:
VERSION=v0.2.0 kubectl create -f https://github.com/k0rdent/kcm/releases/download/${VERSION}/release.yaml -
List Available
ReleasesOnce you've created the new
Releaseyou need to update theManagementobject to use it. Start by viewing all availableReleases:kubectl get releasesNAME AGE kcm-0-0-6 71m kcm-0-0-7 65m kcm-0-2-0 12m -
Patch the
Managementobject with the newReleaseUpdate the
spec.releasefield in theManagementobject to point to the new release. Replace<release-name>with the name of your desired release:RELEASE_NAME=kcm-0-2-0 kubectl patch managements.k0rdent.mirantis.com kcm --patch "{\"spec\":{\"release\":\"${RELEASE_NAME}\"}}" --type=merge -
Verify the Upgrade
Although the change will be made immediately, it will take some time for k0rdent to update the components it should be using. Monitor the readiness of the
Managementobject to ensure the upgrade was successful. For example:kubectl get managements.k0rdent.mirantis.com kcm NAME READY RELEASE AGE kcm True kcm-0-2-0 4m34s