Skip to content

Commit

Permalink
readme: mention CCM and CNI
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Tortuyaux <[email protected]>
Co-authored-by: Thilo Fromm <[email protected]>
  • Loading branch information
tormath1 and t-lo committed Nov 4, 2024
1 parent 9fd07dc commit 94f91f3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions CAPZ-sysext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This demo is divided into three sections:
* Automated, scripted set-up of a ClusterAPI worker cluster on Azure, including live in-place updates
* Full manual walk-through of setting up [Cluster API Azure using Flatcar sysext template](#manual-cluster-api-azure-using-flatcar-sysext-template)
* Full manual walk-through of setting up Cluster API Azure using AKS (mixing Ubuntu and Flatcar nodes)
* Full manual walk-through of setting up Cluster API Azure using AKS (mixing Ubuntu and Flatcar nodes) (TBD)

## Automated set-up of a Cluster API demo cluster on Azure

Expand Down Expand Up @@ -163,6 +163,7 @@ export AZURE_CLIENT_ID="<AppId>"
export AZURE_CLIENT_ID_USER_ASSIGNED_IDENTITY=$AZURE_CLIENT_ID # for compatibility with CAPZ v1.16 templates
export AZURE_CLIENT_SECRET="<Password>"
export AZURE_RESOURCE_GROUP="capz-demo"
export AZURE_LOCATION="centralus"
```

From now, you can just copy-paste:
Expand All @@ -180,14 +181,16 @@ kubectl create secret generic "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" --from-lit
clusterctl init --infrastructure azure
```

### Create the workload cluster

Now, you can generate the workload cluster configuration:

_Notes_:
* at this time, the CAPZ Flatcar sysext PR is still opened (https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/4575) which means that `--infrastructure azure --flavor flatcar-sysext` must be replaced by `--from /path/to/flatcar-sysext/template.yaml`
* Kubernetes version must match sysext-bakery [releases](https://github.com/flatcar/sysext-bakery/releases/tag/latest)

```bash
clusterctl generate cluster capi-quickstart \
clusterctl generate cluster ${AZURE_RESOURCE_GROUP} \
--infrastructure azure \
--kubernetes-version v1.31.1 \
--control-plane-machine-count=3 \
Expand All @@ -204,3 +207,13 @@ After a few minutes, the cluster should be available using latest Flatcar versio
clusterctl get kubeconfig "${AZURE_RESOURCE_GROUP}" > "${AZURE_RESOURCE_GROUP}.kubeconfig"
kubectl --kubeconfig "${AZURE_RESOURCE_GROUP}.kubeconfig" get nodes -o wide
```

Of course, the nodes will not be ready while CNI and CCM are not deployed, here's a simple example using Calico:
```
# CNI
export IPV4_CIDR_BLOCK=$(kubectl get cluster "${AZURE_RESOURCE_GROUP}" -o=jsonpath='{.spec.clusterNetwork.pods.cidrBlocks[0]}')
helm repo add projectcalico https://docs.tigera.io/calico/charts && \
helm install calico projectcalico/tigera-operator --version v3.26.1 -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico/values.yaml --set-string "installation.calicoNetwork.ipPools[0].cidr=${IPV4_CIDR_BLOCK}" --namespace tigera-operator --create-namespace
# CCM
helm install --repo https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo cloud-provider-azure --generate-name --set infra.clusterName=${AZURE_RESOURCE_GROUP} --set "cloudControllerManager.clusterCIDR=${IPV4_CIDR_BLOCK}" --set-string "cloudControllerManager.caCertDir=/usr/share/ca-certificates"
```

0 comments on commit 94f91f3

Please sign in to comment.