Skip to content

Upgrading k0rdent#

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:

  1. Create a new Release object

    Start by creating a Release object in the management cluster that points to the desired version. You can see available versions at https://github.com/k0rdent/kcm/releases. The actual Release object includes information on the templates and resources that are available, as well as the version of the Kubernetes Cluster API. For example, the v0.1.0 Release object looks like this:

    apiVersion: k0rdent.mirantis.com/v1alpha1
    kind: Release
    metadata:
      name: kcm-0-1-0
      annotations:
        helm.sh/resource-policy: keep
    spec:
      version: 0.1.0
      kcm:
        template: kcm-0-1-0
      capi:
        template: cluster-api-0-1-0
      providers:
        - name: k0smotron
          template: k0smotron-0-1-0
        - name: cluster-api-provider-azure
          template: cluster-api-provider-azure-0-1-0
        - name: cluster-api-provider-vsphere
          template: cluster-api-provider-vsphere-0-1-0
        - name: cluster-api-provider-aws
          template: cluster-api-provider-aws-0-1-0
        - name: cluster-api-provider-openstack
          template: cluster-api-provider-openstack-0-1-0
        - name: projectsveltos
          template: projectsveltos-0-45-0
    

    Thankfully, 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.1.0
    kubectl create -f https://github.com/k0rdent/kcm/releases/download/${VERSION}/release.yaml
    
  2. List Available Releases

    Once you've created the new Release you need to update the Management object to use it. Start by viewing all available Releases:

    kubectl get releases
    
    NAME        AGE
    kcm-0-0-6   71m
    kcm-0-0-7   65m
    kcm-0-1-0   12m
    
  3. Patch the Management object with the new Release

    Update the spec.release field in the Management object to point to the new release. Replace <release-name> with the name of your desired release:

    RELEASE_NAME=kcm-0-1-0
    kubectl patch management.kcm kcm --patch "{\"spec\":{\"release\":\"${RELEASE_NAME}\"}}" --type=merge
    
  4. 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 Management object to ensure the upgrade was successful. For example:

    kubectl get management.kcm kcm
    NAME   READY   RELEASE     AGE
    kcm    True    kcm-0-1-0   4m34s