diff --git a/docs/content/calico-cni.md b/docs/content/calico-cni.md index b30ca0a30..c0c628ad5 100644 --- a/docs/content/calico-cni.md +++ b/docs/content/calico-cni.md @@ -6,11 +6,43 @@ When deploying a cluster with CAPI, deployment and configuration of CNI is up to lifecycle hooks, this handler deploys Calico CNI on the new cluster via `ClusterResourceSets` at the `AfterControlPlaneInitialized` phase. -Deployment of Calico is opt-in La cluster must be labelled with `capiext.labs.d2iq.io/cni=calico` for the lifecycle hook -to perform any actions. The hook creates two `ClusterResourceSets`: one to deploy the Tigera Operator, and one to deploy +Deployment of Calico is opt-in using the following configuration for the lifecycle hook to perform any actions. +The hook creates two `ClusterResourceSets`: one to deploy the Tigera Operator, and one to deploy Calico via the Tigera `Installation` CRD. The Tigera Operator CRS is shared between all clusters in the operator, whereas the Calico installation CRS is unique per cluster. +To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` +external patches on `ClusterClass`. + +```yaml +apiVersion: cluster.x-k8s.io/v1beta1 +kind: ClusterClass +metadata: + name: +spec: + patches: + - name: cluster-config + external: + generateExtension: "clusterconfigpatch.capi-runtime-extensions" + discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions" +``` + +On the cluster resource then specify this `cni` value: + +```yaml +apiVersion: cluster.x-k8s.io/v1beta1 +kind: Cluster +metadata: + name: +spec: + topology: + variables: + - name: clusterConfig + value: + cni: + provider: calico +``` + As ClusterResourceSets must exist in the same name as the cluster they apply to, the lifecycle hook copies default ConfigMaps from the same namespace as the CAPI runtime extensions hook pod is running in. This enables users to configure defaults specific for their environment rather than compiling the defaults into the binary. diff --git a/docs/content/cluster-config.md b/docs/content/cluster-config.md index 88ba5fa7e..a400b10ef 100644 --- a/docs/content/cluster-config.md +++ b/docs/content/cluster-config.md @@ -7,7 +7,7 @@ ClusterClasses, allowing for a single configuration variable with nested values. with the least configuration. The included patches are usable individually, but require declaring all the individual patch and variable handlers in the ClusterClass. -To enable the API server certificate SANs enable the `clusterconfigvars` and `clusterconfigpatch` +To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch` external patches on `ClusterClass`. ```yaml @@ -23,7 +23,7 @@ spec: discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions" ``` -On the cluster resource then specify desired certificate SANs values: +On the cluster resource then specify desired values: ```yaml apiVersion: cluster.x-k8s.io/v1beta1 @@ -49,7 +49,6 @@ spec: additionalNo: - no-proxy-1.example.com - no-proxy-2.example.com + cni: + provider: calico ``` - -Applying this configuration will result in the certificate SANs being correctly set in the -`KubeadmControlPlaneTemplate`.