Updating Kubernetes clusters

When a new Kubernetes version becomes available, you can update your Kubernetes cluster to it. An update is non-disruptive for Kubernetes worker nodes, which means that these nodes are updated one by one, with the data availability unaffected. The Kubernetes API will be unavailable during an update, unless high availability is enabled for the master node.

Starting from a Kubernetes cluster update to version 1.24.3, Kubernetes virtual machines are re-created based on a newer Fedora CoreOS image. Such a rolling update is used to preserve the cluster data. Before starting the update, you need to make sure that the compute cluster has enough resources and quotas for at least one extra VM of the largest flavor used by your Kubernetes cluster. If the master and worker node flavors differ, then you should take into account the largest one of them.

Limitations

  • You cannot update Kubernetes clusters with versions 1.15.x–1.17.x to newer versions.
  • You can update Kubernetes clusters only to the next minor version in one iteration. For example, to update a cluster from version 1.25 to 1.27, you need to update it to version 1.26 first.
  • Kubernetes clusters can have only one minor version difference between node groups (for example, 1.26 and 1.27).
  • You cannot manage Kubernetes clusters in the admin panel during an update.

To update a Kubernetes cluster

Admin panel

  1. Click a Kubernetes cluster that is marked with the Update available tag.
  2. On the Kubernetes cluster pane, click Update in the Kubernetes version field.
  3. In the Update window, do the following:

    1. Select a Kubernetes version to update to and follow the provided link to read about API resources that are deprecated or obsoleted in the selected version. Then, click Next.
    2. Choose how to proceed:

      • Select Update all to update all of the node groups in the Kubernetes cluster.
      • Select Custom update to update only specific node groups. The master node group is selected automatically and is mandatory for an update.

  4. In the confirmation window, click Confirm. The update process will start.

    Do not manage Kubernetes virtual machines during the update as it may lead to disruption of the update process and cluster inoperability.

When node groups in a Kubernetes cluster have different versions, the cluster tag changes to Partially updated. In this case, new worker groups will be created with the version of the master node group. To finish the Kubernetes cluster upgrade, you need to repeat the update procedure for worker groups with an older version.

Command-line interface

Use the following command:

vinfra service compute k8saas upgrade [--nodegroups <nodegroups>] <cluster> <version>
--nodegroups <nodegroups>
A comma-separated list of node group IDs to upgrade
<cluster>
Cluster ID or name
<version>
Kubernetes version (v1.28.4, v1.27.8, v1.26.11, v1.25.7, v1.24.3, and v1.23.5)

For example, to upgrade the worker group with the ID 3c71ca36-3505-4c58-b077-36d118835364 in the Kubernetes cluster k8s1 from version v1.27.8 to version v1.28.4, run:

# vinfra service compute k8saas upgrade --nodegroups 3c71ca36-3505-4c58-b077-36d118835364 k8s1 v1.28.4