diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index a36cb54cd2c..7d398ca3747 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -7,6 +7,7 @@ - [Troubleshooting](./topics/troubleshooting.md) - [AAD Integration](./topics/aad-integration.md) - [Addons](./topics/addons.md) + - [AKS Fleet Integration](./topics/aks-fleet-integration.md) - [API Server Endpoint](./topics/api-server-endpoint.md) - [Azure Service Operator](./topics/aso.md) - [Cloud Provider Config](./topics/cloud-provider-config.md) diff --git a/docs/book/src/topics/aks-fleet-integration.md b/docs/book/src/topics/aks-fleet-integration.md new file mode 100644 index 00000000000..1b55355e829 --- /dev/null +++ b/docs/book/src/topics/aks-fleet-integration.md @@ -0,0 +1,26 @@ +# AKS Fleet Integration + +CAPZ supports joining your managed AKS clusters to a single AKS fleet. Azure Kubernetes Fleet Manager (Fleet) enables at-scale management of multiple Azure Kubernetes Service (AKS) clusters. For more documentation on Azure Kubernetes Fleet Manager, refer [AKS Docs](https://learn.microsoft.com/en-us/azure/kubernetes-fleet/overview) + +## Joining a CAPZ Cluster to an AKS Fleet Manager + +To join a CAPZ cluster to an AKS fleet, you must first create an AKS fleet manager. For more information on how to create an AKS fleet manager, refer [AKS Docs](https://learn.microsoft.com/en-us/azure/kubernetes-fleet/quickstart-create-fleet-and-members). This fleet manager will be your point of reference for managing any CAPZ clusters that you join to the fleet. + +Once you have created an AKS fleet manager, you can join your CAPZ cluster to the fleet by adding the `fleetManager` field to your AzureManagedControlPlane resource spec: + +```yaml +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedControlPlane +metadata: + name: ${CLUSTER_NAME} + namespace: default +spec: + fleetManager: + group: fleet-update-group + managerName: fleet-manager-name + managerResourceGroup: fleet-manager-resource-group +``` + +The `managerName` and `managerResourceGroup` fields are the name and resource group of your AKS fleet manager. The `group` field is the name of the update group for the cluster, not to be confused with the resource group. + +When the `fleetManager` field is included, CAPZ will create an AKS fleet member resource which will join the CAPZ cluster to the AKS fleet. The AKS fleet member resource will be created in the same resource group as the CAPZ cluster. diff --git a/test/e2e/aks_fleets_member.go b/test/e2e/aks_fleets_member.go index 993d1c57335..dd24d59d5ed 100644 --- a/test/e2e/aks_fleets_member.go +++ b/test/e2e/aks_fleets_member.go @@ -37,8 +37,9 @@ import ( ) type AKSFleetsMemberInput struct { - Cluster *clusterv1.Cluster - WaitIntervals []interface{} + Cluster *clusterv1.Cluster + WaitIntervals []interface{} + WaitFleetIntervals []interface{} } const ( @@ -101,7 +102,7 @@ func AKSFleetsMemberSpec(ctx context.Context, inputGetter func() AKSFleetsMember }, } g.Expect(mgmtClient.Update(ctx, infraControlPlane)).To(Succeed()) - }, input.WaitIntervals...).Should(Succeed()) + }, input.WaitFleetIntervals...).Should(Succeed()) By("Ensuring the fleet member is created and attached to the managed cluster") Eventually(func(g Gomega) { @@ -112,6 +113,6 @@ func AKSFleetsMemberSpec(ctx context.Context, inputGetter func() AKSFleetsMember g.Expect(fleetsMember.Properties).NotTo(BeNil()) expectedID := azure.ManagedClusterID(getSubscriptionID(Default), infraControlPlane.Spec.ResourceGroupName, input.Cluster.Name) g.Expect(fleetsMember.Properties.ClusterResourceID).To(Equal(expectedID)) - }, input.WaitIntervals...).Should(Succeed()) + }, input.WaitFleetIntervals...).Should(Succeed()) } diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index 1a68cd66b4e..0aee6bc1694 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -848,8 +848,9 @@ var _ = Describe("Workload cluster creation", func() { By("attaching the cluster to azure fleet", func() { AKSFleetsMemberSpec(ctx, func() AKSFleetsMemberInput { return AKSFleetsMemberInput{ - Cluster: result.Cluster, - WaitIntervals: e2eConfig.GetIntervals(specName, "wait-worker-nodes"), + Cluster: result.Cluster, + WaitIntervals: e2eConfig.GetIntervals(specName, "wait-worker-nodes"), + WaitFleetIntervals: e2eConfig.GetIntervals(specName, "wait-machine-pool-nodes"), } }) })