Define re-usable update strategies using Azure Kubernetes Fleet Manager

Administrators can control the sequence of updates to Fleet-managed clusters by defining stages, groups and optional inter-stage pauses. These sequences can be saved as update strategies which can be managed independently of update runs or auto-upgrades, allowing strategies to be reused as required.

This article covers how to define update strategies using groups and stages.

A diagram showing an example update strategy containing two update stages. Each update stage contains two update groups. Each update group contains two member clusters.

Prerequisites

  • Read the conceptual overview of Fleet updates, which provides an explanation of update runs, stages, groups, and strategies referenced in this guide.

  • 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.

  • Set the following environment variables:

    export GROUP=<resource-group>
    export FLEET=<fleet-name>
    export CLUSTERID=<aks-cluster-resource-id>
    export STRATEGY=<strategy-name>
    
  • If you're following the Azure CLI instructions in this article, you need Azure CLI version 2.61.0 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 az extension update command to update to the latest version of the extension released:

    az extension update --name fleet
    

Assign clusters to update groups

Before clusters can be used in update strategies they must be added to update groups which can be used in update stages. Within an update stage, updates are applied to each update group in parallel. Within an update group, member clusters update sequentially.

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

Note

A fleet member can only be a part of one update group, but an update group can have multiple fleet members assigned to 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.

Assign to group when adding member cluster to the fleet

  1. In the Azure portal, navigate to your Azure Kubernetes Fleet Manager resource.

  2. From the service menu, under Settings, select Member clusters > Add.

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

  3. Select the cluster that you want to add, and then select Next: Review + add.

  4. Enter the name of the update group that you want to assign the cluster to, and then select Add.

    Screenshot of the Azure portal page for Azure Kubernetes Fleet Manager review and add step for member clusters.

Assign an existing fleet member to an update group

  1. In the Azure portal, navigate to your Azure Kubernetes Fleet Manager resource.

  2. From the service menu, under Settings, select Member clusters.

  3. Select the clusters that you want to assign to an update group, and then select Assign update group

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

  4. Enter the name of the update group that you want to assign the cluster to, and then select Assign.

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

Create an update strategy

An update strategy consists of one or more stages, where a stage can contain one or more update groups.

  1. In the Azure portal, navigate to your Azure Kubernetes Fleet Manager resource.

  2. From the service menu, under Settings, select Multi-cluster update > Strategies, then Create.

  3. Enter a name for the strategy.

  4. The first time you view the page, an update strategy explanation diagram is displayed which can help visualize how strategies function.

    A screenshot of the Azure portal showing creation of update strategy.

  5. Select Create Stage and enter:

    • Stage name - name the stage - it must be unique across all stage names in the fleet.
    • (Optional) Pause after stage - select this option if you would like to define a pause before moving to the next stage.
    • (Optional) Pause duration - select a pre-defined duration, or enter a custom value in seconds.

    A screenshot of the Azure portal showing creation of Azure Kubernetes Fleet Manager update strategy stage.

  6. Assign one or more Update Group to the stage, and then select Create.

    A screenshot of the Azure portal showing creation of Azure Kubernetes Fleet Manager update strategy stage, selecting update groups to include.

Next steps

You can use an update strategy as part of a manual update run or an auto-upgrade profile. See: