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.
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
On the page for your Azure Kubernetes Fleet Manager resource, go to the Multi-cluster update menu and select Create.
You can choose either One by one or Stages.
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.
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:
- The second method is to assign an existing fleet member to an update group. For example:
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.
On the page for your Azure Kubernetes Fleet Manager resource, navigate to Multi-cluster update and select Create.
Select Stages, and then choose either Node image (latest) + Kubernetes version or Node image (latest), depending on your desired upgrade scope.
Under Stages, select Create Stage. You can now specify the stage name and the duration to wait after each stage.
Choose the update groups that you want to include in this stage.
After you define all your stages and order them by using the Move up and Move down controls, proceed with creating the update run.
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for