Orchestrate updates across multiple clusters by using Azure Kubernetes Fleet Manager

Platform admins managing Kubernetes fleets with large number of clusters often have problems with staging their updates in a safe and predictable way across multiple clusters. To address this pain point, Kubernetes Fleet Manager (Fleet) allows you to orchestrate updates across multiple clusters using update runs, stages, groups, and strategies.

Screenshot of the Azure portal pane for a fleet resource, showing member cluster Kubernetes versions and node images in use across all node pools of member clusters.

Prerequisites

  • Read the conceptual overview of this feature, which provides an explanation of update strategies, runs, stages, and groups references in this document.

  • You must have a fleet resource with one or more member clusters. If not, follow the quickstart to create a Fleet resource and join Azure Kubernetes Service (AKS) clusters as members. This walkthrough demonstrates a fleet resource with five AKS member clusters as an example.

  • Set the following environment variables:

    export GROUP=<resource-group>
    export FLEET=<fleet-name>
    
  • If you're following the Azure CLI instructions in this article, you need Azure CLI version 2.53.1 or later installed. To install or upgrade, see Install the Azure CLI.

  • You also need the fleet Azure CLI extension, which you can install by running the following command:

    az extension add --name fleet
    

    Run the following command to update to the latest version of the extension released:

    az extension update --name fleet
    

Update all clusters one by one

  1. On the page for your Azure Kubernetes Fleet Manager resource, go to the Multi-cluster update menu and select Create.

  2. You can choose either One by one or Stages.

    Screenshot of the Azure portal pane for creating update runs that update clusters one by one in Azure Kubernetes Fleet Manager.

  3. For upgrade scope, you can choose to either update both the Kubernetes version and the node image version or you can update only your Node image version only.

    Screenshot of the Azure portal pane for creating update runs. The upgrade scope section is shown.

    For the node image, the following options are available:

    • Latest: Updates every AKS cluster in the update run to the latest image available for that cluster in its region.
    • Consistent: As it's possible for an update run to have AKS clusters across multiple regions where the latest available node images can be different (check release tracker for more information). The update run picks the latest common image across all these regions to achieve consistency.

Update clusters in a specific order

Update groups and stages provide more control over the sequence that update runs follow when you're updating the clusters. Within an update stage, updates are applied to all the different update groups in parallel; within an update group, member clusters update sequentially.

Assign a cluster to an update group

You can assign a member cluster to a specific update group in one of two ways.

  • Assign to group when adding member cluster to the fleet. For example:
  1. On the page for your Azure Kubernetes Fleet Manager resource, go to Member clusters.

    Screenshot of the Azure portal page for Azure Kubernetes Fleet Manager member clusters.

  2. Specify the update group that the member cluster should belong to.

    Screenshot of the Azure portal page for adding member clusters to Azure Kubernetes Fleet Manager and assigning them to groups.

  • The second method is to assign an existing fleet member to an update group. For example:
  1. On the page for your Azure Kubernetes Fleet Manager resource, navigate to Member clusters. Choose the member clusters that you want, and then select Assign update group.

    Screenshot of the Azure portal page for assigning existing member clusters to a group.

  2. Specify the group name, and then select Assign.

    Screenshot of the Azure portal page for member clusters that shows the form for updating a member cluster's group.

Note

Any fleet member can only be a part of one update group, but an update group can have multiple fleet members inside it. An update group itself is not a separate resource type. Update groups are only strings representing references from the fleet members. So, if all fleet members with references to a common update group are deleted, that specific update group will cease to exist as well.

Define an update run and stages

You can define an update run using update stages in order to sequentially order the application of updates to different update groups. For example, a first update stage might update test environment member clusters, and a second update stage would then subsequently update production environment member clusters. You can also specify a wait time between the update stages.

  1. On the page for your Azure Kubernetes Fleet Manager resource, navigate to Multi-cluster update and select Create.

  2. Select Stages, and then choose either Node image (latest) + Kubernetes version or Node image (latest), depending on your desired upgrade scope.

  3. Under Stages, select Create Stage. You can now specify the stage name and the duration to wait after each stage.

    Screenshot of the Azure portal page for creating a stage and defining wait time.

  4. Choose the update groups that you want to include in this stage.

    Screenshot of the Azure portal page for stage creation that shows the selection of upgrade groups.

  5. After you define all your stages and order them by using the Move up and Move down controls, proceed with creating the update run.

  6. In the Multi-cluster update menu, choose the update run and select Start.

Create an update run using update strategies

In the previous section, creating an update run required the stages, groups, and their order to be specified each time. Update strategies simplify this by allowing you to store templates for update runs.

Note

It is possible to create multiple update runs with unique names from the same update strategy.

When creating your update runs, you are given an option to create an update strategy at the same time, effectively saving the run as a template for subsequent update runs.

  1. Save an update strategy while creating an update run:

    A screenshot of the Azure portal showing update run stages being saved as an update strategy.

  2. The update strategy you created can later be referenced when creating new subsequent update runs:

    A screenshot of the Azure portal showing the creation of a new update run. The 'Copy from existing strategy' button is highlighted.