More

Update Kubernetes: launch, modes and transitions between versions

Where to run the update

A cluster update, including the Kubernetes version, can be started from the dashboard of the management or client cluster, or by using CLI commands.


Where to see available versions

In the GUI, the Update block on the cluster dashboard. If at least one new version is available, the block reports it directly. The full list of stable versions available for an update from the current version opens from the update management button.

Full map - Update version map.

Screenshot: managing updates on the dashboard

Cluster update block

Click Manage to select the version and configure update schedules.

Start cluster update

In the CLI, read the list in the management cluster, on ClusterInfo. The object name and namespace match the cluster name. Replace clustername with the cluster name:

kubectl get clusterinfo clustername -n clustername -o jsonpath='{.status.update.availableUpdates}'

ClusterUpdateChannel in the same namespace builds the list. If the cluster uses the same registry as the management cluster, the Cluster management module (shturval-cluster-manager) requests the list. If the registry is different, the client cluster runs the CronJob cluster-available-updates, and the result is read from the ConfigMap of the same name in the shturval-cluster-manager namespace. If the version does not appear in the GUI, follow Update troubleshooting.


Recommendations before updating

  1. Review the release notes of the target version - there may be breaking changes and migration steps.
  2. Create a backup of the management cluster before upgrading.
  3. Check the version map - make sure forward navigation is supported. If not, plan to upgrade via an intermediate version.

Update client clusters only after upgrading the management cluster!


Update modes

The update is launched manually - through the GUI or kubectl.

  1. Select a cluster in the left menu.
  2. On the dashboard, find the “Update” block (next to the current version of the cluster).
  3. Click Manage.
  4. In the modal window, select a version from the list of available ones.
  5. Click Update.

From the update window you can follow a link to the release list in the public documentation. Before selecting a version, check the release notes for changes and any additional actions required before and after the update starts.

If “No updates” is displayed, you have the latest available version for the current channel.

Screenshot: window for selecting a version for cluster update

Version selection window for cluster update

Run the command in the management cluster. The name and namespace of ClusterConfig match the cluster name. Replace clustername with the cluster name and X.Y.Z with the target version:

kubectl patch clusterconfig clustername -n clustername --type=merge -p '{"spec":{"releaseVersion":"X.Y.Z"}}'

Changing spec.releaseVersion starts the update. Progress is described in Release update progress. To set the strategy together with the version, see Cluster update strategies.

Deferred update lets you configure one or more schedules. The system starts an update automatically when a new version is available.

  1. Cluster dashboard → “Update” block → Manage.
  2. Click + next to Deferred update settings.
  3. Specify:
    • Schedule UTC - in cron format (values separated by spaces);
    • Update window duration — how much time can be used for updating (default 24 hours, minimum 30 minutes);
    • Behavior when the window is exceeded: stop (UpdatePaused) or continue;
    • Allow minor versions — when enabled, the window selects the highest available version. When disabled, it selects the highest version with the same major and minor parts as the cluster’s current version.
  4. Click Add.

After the deferred update settings are saved, the date and time of the next cluster update are calculated and shown in UTC. If the next run cannot be calculated yet, the date and time are not shown.

Screenshot: window for creating a schedule for cluster update

Window for creating a cluster update schedule

Create a ClusterUpdateSchedule in the management cluster. The resource and ClusterConfig must be in the same namespace. Names can differ. Replace clustername with the cluster name:

apiVersion: cluster.shturval.tech/v1beta1
kind: ClusterUpdateSchedule
metadata:
  name: update-schedule
  namespace: clustername
spec:
  schedule: "0 8 26 9 *"
  updatePeriod: "10h0m0s"
  pauseIfUpdatePeriodExceed: false
  allowMinorVersion: true
ParameterDescription
scheduleFive-field cron schedule, in UTC
updatePeriodUpdate window duration, for example 24h0m0s
pauseIfUpdatePeriodExceedPause the update when the window is exceeded (true) or continue (false)
allowMinorVersiontrue — select the highest available version. false — select the highest version with the same major and minor parts as the current version

By default, the controller reconciles the schedule every 10 minutes. In an open window it checks that the cluster is ready, selects a version from the list of available updates and writes spec.releaseVersion and spec.update.followSchedule (the schedule name) to ClusterConfig. That starts the update.

If allowMinorVersion is true, the highest available version is selected. If allowMinorVersion is false, the highest version with the same major and minor parts as the cluster’s current version is selected. While the version list is not ready, a scheduled update does not start. If there is no suitable version, status.nextUpdateStart, status.nextUpdateEnd and status.nextUpdateVersion are cleared.

Changing and deleting a schedule

  • Change — select a schedule in the modal window and configure it again. If an update is already in progress, the new schedule applies from then on.
  • Delete — possible when ClusterConfig.spec.update.followSchedule no longer contains this schedule name. While the reference exists, deletion is blocked.

While the window is closed, status.nextUpdateStart and status.nextUpdateEnd of ClusterUpdateSchedule store the start and end of the next window in UTC. status.nextUpdateVersion stores the version the schedule has already written to the cluster. If the next run cannot be calculated, the window start and end stay empty, and the date is not shown in the GUI.

If this schedule paused the update, the update continues when the next window opens, and the phase becomes Updating again.


Upgrade steps

After launch, the update goes through the following stages (displayed on the dashboard):

  1. Preparing the update — the controller builds and starts the sequence of stages for the target version.
  2. Forced removal of outdated services - this step can be skipped if such services are not available.
  3. Updating shturval-node-config - module for managing node configurations.
  4. Updating the Kubernetes version — updates Kubernetes components in the cluster.
  5. Updating system services — updates platform services (monitoring, logging, and others).

Stage statuses

Color indication on the dashboard:

  • Green — the stage has been successfully completed;
  • Yellow — the stage is being executed;
  • Gray — the stage is not initialized.

If the update was started by a schedule, the window has closed and the behavior is set to stop, the update pauses. The dashboard shows UpdatePaused, and the ClusterConfig phase becomes Paused. While the window stays closed, the platform checks it every 30 seconds. When the next window of this schedule opens, the update continues. To continue without waiting for the window, click Continue outside schedule.

Release update progress

The Cluster management module (shturval-cluster-manager) performs the update. The controller moves the cluster from the current version status.update.currentVersion to the target spec.releaseVersion. This controller does not start during the initial deployment of the management cluster.

Changing spec.releaseVersion starts the update. While the current and target versions differ, the cluster first enters the queue.

PhaseWhat happens
QueuedThe update is waiting to start or for a free slot. By default, at most 5 clusters can be in the Updating and Paused phases at the same time. If no slot is free, the next check runs in 5 minutes
UpdatingThe target version is in the list of available updates, and the update is running. Stages run one after another, and the condition of a finished stage becomes successful
PausedThe update follows a schedule, the window is closed and pause on window expiry is enabled. While the window stays closed, the check repeats every 30 seconds. The update continues in the next window of this schedule
CompleteThe version of the base system services matches the target version. The update is finished

If the requested version is not in the list of available updates, the cluster stays in Queued. The platform retries the check once a minute. If the current version already matches the target, the update finishes without checking the list again.

If the update stages have already finished and the version of the base system services still does not match the target, the check repeats in one minute.

Read the phase in the management cluster. Replace clustername with the cluster name:

kubectl get clusterconfig clustername -n clustername -o jsonpath='{.status.update.phase}'

During an update, cluster-manager updates system services to the chart versions of the target release. ShturvalServicePatch (SSP) objects are left unchanged. The resulting service parameters can change if the new chart version adds or renames fields.


Custom resources

Resources of the cluster.shturval.tech group live in the management cluster. The name and namespace of ClusterConfig, ClusterInfo and ClusterUpdateChannel match the cluster name.

ResourcePurpose
ClusterConfigTarget version in spec.releaseVersion, strategy and schedule reference. Progress is in status.update
ClusterInfoAvailable versions and strategies in status.update
ClusterUpdateChannelUpdate channel. stable by default. Publishes the release list
ClusterUpdateScheduleUpdate schedule and window

The controller is described on the Cluster management module (shturval-cluster-manager) page. A general overview of platform custom resources is on Custom resources in the platform.


Special steps for individual transitions

Some transitions require additional steps. If manual action is required, this is indicated in the release notes of the target version.


Updating cluster nodes

With the InPlace strategy, the Kubernetes version is updated on existing nodes, but InfraMachineTemplate remains unchanged. New nodes are therefore created with the Kubernetes version from that template. After the update, create a new VM template in the infrastructure provider and replace InfraMachineTemplate in the node groups. With RollingUpdate, nodes are replaced using the target-version template from InfrastructureProvider. See VM nodes and templates.


Cluster update strategies

Set the strategy in ClusterConfig, in spec.update.updateStrategy. Allowed values are InPlace and RollingUpdate. InPlace is the default.

ValueWhat happens
InPlaceThe Kubernetes version is updated on nodes that already exist. This is the default. New nodes are created from the current InfraMachineTemplate until that template is replaced.
RollingUpdate1Nodes are replaced. For each node group, the VM template of the target Kubernetes version is taken from InfrastructureProvider. If several templates share one version, the first one in alphabetical order is used. If there is no VM template of the target Kubernetes version, the update stops. Before you start the update, add a VM template of the target version to the provider.

1 If the cluster has RawFile local volumes, an update with the RollingUpdate strategy does not finish. Change the strategy to InPlace. On a provider with CSI, use external storage instead of RawFile.

RollingUpdate is unavailable for a cluster on the Shturval v2 provider, including a hybrid cluster. The strategies available to the cluster are stored in ClusterInfo.status.update.availableStrategies.

You can save the strategy separately from the version: set only spec.update.updateStrategy in ClusterConfig. The target version stays the same. If it already matches the current version, the cluster is not moved to a new release, and the saved strategy is used on the next update. To start the update immediately with the selected strategy, set the strategy and the version together.

  1. In the left menu, open the management cluster.
  2. Go to Administration → Custom Resources → API group cluster.shturval.tech → ClusterConfig and open the object named after the cluster you need.
  3. On the Manifest tab, change spec.update:
    • if the update block is missing, add it;
    • if updateStrategy is already set, replace the value with InPlace or RollingUpdate.
  4. For a cluster on the Shturval v2 provider, including a hybrid cluster, set InPlace.
  5. Do not change spec.releaseVersion. The target version stays the same. If it already matches the current version, the cluster is not moved to a new release.
  6. Run a check and save the manifest.
spec:
  update:
    updateStrategy: RollingUpdate

Replace clustername with the cluster name. The examples use RollingUpdate. To update nodes in place, use InPlace instead.

To change only the strategy, do not pass releaseVersion:

kubectl patch clusterconfig clustername -n clustername --type=merge -p '{"spec":{"update":{"updateStrategy":"RollingUpdate"}}}'

The command writes spec.update.updateStrategy and does not change the target version. If the target version already matches the current one, the cluster is not moved to a new release.

To set the strategy together with the version, pass both fields. Replace X.Y.Z with the target version:

kubectl patch clusterconfig clustername -n clustername --type=merge -p '{"spec":{"releaseVersion":"X.Y.Z","update":{"updateStrategy":"RollingUpdate"}}}'

The command writes the strategy and the target version. The update starts to version X.Y.Z with the selected strategy.

Create the schedule in Update modes. It cannot be deleted while ClusterConfig.spec.update.followSchedule contains its name.