Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Dec 4, 2023
1 parent d688d75 commit 888e648
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 26 additions & 0 deletions docs/book/src/topics/aks-fleet-integration.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 5 additions & 4 deletions test/e2e/aks_fleets_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import (
)

type AKSFleetsMemberInput struct {
Cluster *clusterv1.Cluster
WaitIntervals []interface{}
Cluster *clusterv1.Cluster
WaitIntervals []interface{}
WaitFleetIntervals []interface{}
}

const (
Expand Down Expand Up @@ -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) {
Expand All @@ -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())

}
5 changes: 3 additions & 2 deletions test/e2e/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
})
})
Expand Down

0 comments on commit 888e648

Please sign in to comment.