Skip to content

Commit a58f30b

Browse files
authored
docs: add new Calico variables (#160)
1 parent 5aac3c2 commit a58f30b

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

docs/content/calico-cni.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,43 @@ When deploying a cluster with CAPI, deployment and configuration of CNI is up to
66
lifecycle hooks, this handler deploys Calico CNI on the new cluster via `ClusterResourceSets` at the
77
`AfterControlPlaneInitialized` phase.
88

9-
Deployment of Calico is opt-in La cluster must be labelled with `capiext.labs.d2iq.io/cni=calico` for the lifecycle hook
10-
to perform any actions. The hook creates two `ClusterResourceSets`: one to deploy the Tigera Operator, and one to deploy
9+
Deployment of Calico is opt-in using the following configuration for the lifecycle hook to perform any actions.
10+
The hook creates two `ClusterResourceSets`: one to deploy the Tigera Operator, and one to deploy
1111
Calico via the Tigera `Installation` CRD. The Tigera Operator CRS is shared between all clusters in the operator,
1212
whereas the Calico installation CRS is unique per cluster.
1313

14+
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch`
15+
external patches on `ClusterClass`.
16+
17+
```yaml
18+
apiVersion: cluster.x-k8s.io/v1beta1
19+
kind: ClusterClass
20+
metadata:
21+
name: <NAME>
22+
spec:
23+
patches:
24+
- name: cluster-config
25+
external:
26+
generateExtension: "clusterconfigpatch.capi-runtime-extensions"
27+
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
28+
```
29+
30+
On the cluster resource then specify this `cni` value:
31+
32+
```yaml
33+
apiVersion: cluster.x-k8s.io/v1beta1
34+
kind: Cluster
35+
metadata:
36+
name: <NAME>
37+
spec:
38+
topology:
39+
variables:
40+
- name: clusterConfig
41+
value:
42+
cni:
43+
provider: calico
44+
```
45+
1446
As ClusterResourceSets must exist in the same name as the cluster they apply to, the lifecycle hook copies default
1547
ConfigMaps from the same namespace as the CAPI runtime extensions hook pod is running in. This enables users to
1648
configure defaults specific for their environment rather than compiling the defaults into the binary.

docs/content/cluster-config.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ClusterClasses, allowing for a single configuration variable with nested values.
77
with the least configuration. The included patches are usable individually, but require declaring all the individual
88
patch and variable handlers in the ClusterClass.
99

10-
To enable the API server certificate SANs enable the `clusterconfigvars` and `clusterconfigpatch`
10+
To enable the meta handler enable the `clusterconfigvars` and `clusterconfigpatch`
1111
external patches on `ClusterClass`.
1212

1313
```yaml
@@ -23,7 +23,7 @@ spec:
2323
discoverVariablesExtension: "clusterconfigvars.capi-runtime-extensions"
2424
```
2525
26-
On the cluster resource then specify desired certificate SANs values:
26+
On the cluster resource then specify desired values:
2727
2828
```yaml
2929
apiVersion: cluster.x-k8s.io/v1beta1
@@ -49,7 +49,6 @@ spec:
4949
additionalNo:
5050
- no-proxy-1.example.com
5151
- no-proxy-2.example.com
52+
cni:
53+
provider: calico
5254
```
53-
54-
Applying this configuration will result in the certificate SANs being correctly set in the
55-
`KubeadmControlPlaneTemplate`.

0 commit comments

Comments
 (0)