Why?
A solution to manage multiple Azure Kubernetes Service (AKS) clusters at scale. A secure and compliant solution to streamline operations, maintenance, improve performance, and ensure efficient resource utilization. Addresses the challenges of multi-cluster scenarios
- orchestrating cluster updates
- propagating Kubernetes resources
- balancing multi-cluster loads
Pointers
- Orchestrates application updates and upgrades across multiple clusters
- Certain Kubernetes objects to deploy on all or certain set of clusters
- Clusters can be the same subscription or different subscription or even in different region but should be under the same tenant
- Upgrade group: Updates are applied in parallel
- Make sure member cluster should be in the running state before joining them to Fleet
- There are two fleet options available, with Hub and without the Hub
- Supports private clusters
- CRP is a cluster-scoped resource
HOW?
Run the below commands with Azure CLI
Step 1: Add the fleet extension
az extension add -n fleet
Step 2: Create a fleet manager
az fleet create --resource-group <name of the resource group> --name <name of the fleet> --location <region> --enable-hub --enable-private-cluster --enable-managed-identity --agent-subnet-id <subent ID> --vm-size <vm size>
Step 3: An AKS cluster with 1 node gets created. Get into this Hub cluster
az fleet get-credentials --resource-group <name of the resource group> --name <name of the fleet>
Step 4: Add and view member clusters
az fleet member create --resource-group <name of the resource group> --fleet-name <name of the fleet> --name <name of the membercluster> --member-cluster-id <resource ID of the member cluster>
az fleet member list --resource-group <name of the resource group> --fleet-name <name of the fleet> -o table
Sample CRP deployment
kubectl label membercluster <name of the member cluster> <name of the label>=<value of the label> --overwrite
apiVersion: placement.kubernetes-fleet.io/v1beta1
kind: ClusterResourcePlacement
metadata:
name: crp-asd-prod
spec:
policy:
placementType: PickAll
affinity:
clusterAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
clusterSelectorTerms:
- labelSelector:
matchLabels:
crp: prod
resourceSelectors:
- group: ""
kind: Namespace
name: dev
version: v1
- group: ""
kind: Namespace
name: qa
version: v1
Utilization Best Practices
- Plan to integrate with your DevOps platform to manage the dynamic nature of workloads. The integration is extremely helpful and easy to adopt for the dev teams, as deployments were synced across other clusters.
- The service is a viable candidate for multi-cluster management, disaster recovery and migration strategy.
Happy Learning 🙂
Reference link: fleet/docs at main · Azure/fleet · GitHub
Published Jan 22, 2025
Version 1.0AmrutaD
Microsoft
Joined August 27, 2024
Apps on Azure Blog
Follow this blog board to get notified when there's new activity