From 888e648de18010cb80f5cd9cba6ab5edc27f5ad2 Mon Sep 17 00:00:00 2001 From: willie-yao <williamyao@microsoft.com> Date: Sat, 2 Dec 2023 01:13:36 +0000 Subject: [PATCH] Add docs --- docs/book/src/SUMMARY.md | 1 + docs/book/src/topics/aks-fleet-integration.md | 26 +++++++++++++++++++ test/e2e/aks_fleets_member.go | 9 ++++--- test/e2e/azure_test.go | 5 ++-- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 docs/book/src/topics/aks-fleet-integration.md diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index a36cb54cd2cb..7d398ca3747e 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 000000000000..1b55355e8295 --- /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 993d1c573356..dd24d59d5ed8 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 1a68cd66b4e5..0aee6bc16945 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"), } }) })