Blog Post

Apps on Azure Blog
2 MIN READ

Getting started with Azure Fleet Manager

AmrutaD's avatar
AmrutaD
Icon for Microsoft rankMicrosoft
Jan 22, 2025

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

  1. Orchestrates application updates and upgrades across multiple clusters
  2. Certain Kubernetes objects to deploy on all or certain set of clusters
  3. Clusters can be the same subscription or different subscription or even in different region but should be under the same tenant
  4. Upgrade group: Updates are applied in parallel
  5. Make sure member cluster should be in the running state before joining them to Fleet
  6. There are two fleet options available, with Hub and without the Hub
  7. Supports private clusters
  8. 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

  1. 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. 
  2. 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.0
No CommentsBe the first to comment