Skip to content

Commit 493d358

Browse files
authored
🌱 Update resource in docs (#12562)
* update resource in docs Signed-off-by: sivchari <[email protected]> * address review comment Signed-off-by: sivchari <[email protected]> * fix review findings again Signed-off-by: sivchari <[email protected]> * drop empty spec Signed-off-by: sivchari <[email protected]> --------- Signed-off-by: sivchari <[email protected]>
1 parent 2482865 commit 493d358

File tree

9 files changed

+56
-59
lines changed

9 files changed

+56
-59
lines changed

docs/book/src/developer/providers/contracts/bootstrap-config.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ To apply the label to CRDs it’s possible to use labels in your `kustomization.
140140
```yaml
141141
labels:
142142
- pairs:
143-
cluster.x-k8s.io/v1alpha2: v1alpha1
144-
cluster.x-k8s.io/v1alpha3: v1alpha2
145143
cluster.x-k8s.io/v1beta1: v1beta1
144+
cluster.x-k8s.io/v1beta2: v1beta2
146145
```
147146

148147
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/control-plane.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ To apply the label to CRDs it’s possible to use labels in your `kustomization.
165165
```yaml
166166
labels:
167167
- pairs:
168-
cluster.x-k8s.io/v1alpha2: v1alpha1
169-
cluster.x-k8s.io/v1alpha3: v1alpha2
170168
cluster.x-k8s.io/v1beta1: v1beta1
169+
cluster.x-k8s.io/v1beta2: v1beta2
171170
```
172171

173172
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/infra-cluster.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ To apply the label to CRDs it’s possible to use labels in your `kustomization.
149149
```yaml
150150
labels:
151151
- pairs:
152-
cluster.x-k8s.io/v1alpha2: v1alpha1
153-
cluster.x-k8s.io/v1alpha3: v1alpha2
154152
cluster.x-k8s.io/v1beta1: v1beta1
153+
cluster.x-k8s.io/v1beta2: v1beta2
155154
```
156155

157156
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/developer/providers/contracts/infra-machine.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ To apply the label to CRDs it’s possible to use labels in your `kustomization.
141141
```yaml
142142
labels:
143143
- pairs:
144-
cluster.x-k8s.io/v1alpha2: v1alpha1
145-
cluster.x-k8s.io/v1alpha3: v1alpha2
146144
cluster.x-k8s.io/v1beta1: v1beta1
145+
cluster.x-k8s.io/v1beta2: v1beta2
147146
```
148147

149148
An example of this is in the [Kubeadm Bootstrap provider](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.1/controlplane/kubeadm/config/crd/kustomization.yaml).

docs/book/src/tasks/bootstrap/kubeadm-bootstrap/index.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ infrastructure object.
1717

1818
```yaml
1919
kind: DockerCluster
20-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
20+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
2121
metadata:
2222
name: my-cluster-docker
2323
---
@@ -37,20 +37,17 @@ the `KubeadmConfig` bootstrap object.
3737

3838
```yaml
3939
kind: KubeadmConfig
40-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
40+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
4141
metadata:
4242
name: my-control-plane1-config
43-
spec:
44-
initConfiguration:
45-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
4643
---
4744
kind: DockerMachine
48-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
45+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
4946
metadata:
5047
name: my-control-plane1-docker
5148
---
5249
kind: Machine
53-
apiVersion: cluster.x-k8s.io/v1beta1
50+
apiVersion: cluster.x-k8s.io/v1beta2
5451
metadata:
5552
name: my-control-plane1
5653
labels:
@@ -60,12 +57,12 @@ metadata:
6057
spec:
6158
bootstrap:
6259
configRef:
60+
apiGroup: bootstrap.cluster.x-k8s.io
6361
kind: KubeadmConfig
64-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
6562
name: my-control-plane1-config
6663
infrastructureRef:
64+
apiGroup: infrastructure.cluster.x-k8s.io
6765
kind: DockerMachine
68-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
6966
name: my-control-plane1-docker
7067
version: "v1.19.1"
7168
```
@@ -107,38 +104,28 @@ Valid combinations of configuration objects are:
107104
Bootstrap control plane node:
108105
```yaml
109106
kind: KubeadmConfig
110-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
107+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
111108
metadata:
112109
name: my-control-plane1-config
113-
spec:
114-
initConfiguration:
115-
nodeRegistration:
116-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
117110
```
118111

119112
Additional control plane nodes:
120113
```yaml
121114
kind: KubeadmConfig
122-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
115+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
123116
metadata:
124117
name: my-control-plane2-config
125118
spec:
126119
joinConfiguration:
127-
nodeRegistration:
128-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
129120
controlPlane: {}
130121
```
131122

132123
worker nodes:
133124
```yaml
134125
kind: KubeadmConfig
135-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
126+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
136127
metadata:
137128
name: my-worker1-config
138-
spec:
139-
joinConfiguration:
140-
nodeRegistration:
141-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
142129
```
143130

144131
### Bootstrap Orchestration

docs/book/src/tasks/bootstrap/kubeadm-bootstrap/kubelet-config.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This method is easy to replace the whole kubelet configuration generated by kube
2222
### KubeadmControlPlaneTemplate
2323

2424
```yaml
25-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
25+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
2626
kind: KubeadmControlPlaneTemplate
2727
metadata:
2828
name: cloudinit-control-plane
@@ -98,19 +98,21 @@ spec:
9898
criSocket: unix:///var/run/containerd/containerd.sock
9999
# Here we configure kubelet to use the KubeletConfiguration file we put on nodes via KubeadmConfigSpec.files
100100
kubeletExtraArgs:
101-
config: "/etc/kubernetes/kubelet/config.yaml"
101+
- name: config
102+
value: "/etc/kubernetes/kubelet/config.yaml"
102103
joinConfiguration:
103104
nodeRegistration:
104105
criSocket: unix:///var/run/containerd/containerd.sock
105106
# Here we configure kubelet to use the KubeletConfiguration file we put on nodes via KubeadmConfigSpec.files
106107
kubeletExtraArgs:
107-
config: "/etc/kubernetes/kubelet/config.yaml"
108+
- name: config
109+
value: "/etc/kubernetes/kubelet/config.yaml"
108110
```
109111
110112
### KubeadmConfigTemplate
111113
112114
```yaml
113-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
115+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
114116
kind: KubeadmConfigTemplate
115117
metadata:
116118
name: cloudinit-default-worker-bootstraptemplate
@@ -185,7 +187,8 @@ spec:
185187
criSocket: unix:///var/run/containerd/containerd.sock
186188
# Here we configure kubelet to use the KubeletConfiguration file we put on nodes via KubeadmConfigSpec.files
187189
kubeletExtraArgs:
188-
config: "/etc/kubernetes/kubelet/config.yaml"
190+
- name: config
191+
value: "/etc/kubernetes/kubelet/config.yaml"
189192
```
190193
191194
## Set kubelet flags via `KubeadmConfigSpec.kubeletExtraArgs`
@@ -197,7 +200,7 @@ This method is useful when you want to set kubelet flags that are not configurab
197200
### KubeadmControlPlaneTemplate
198201

199202
```yaml
200-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
203+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
201204
kind: KubeadmControlPlaneTemplate
202205
metadata:
203206
name: kubelet-extra-args-control-plane
@@ -211,23 +214,29 @@ spec:
211214
criSocket: unix:///var/run/containerd/containerd.sock
212215
# Set kubelet flags via KubeadmConfigSpec.kubeletExtraArgs
213216
kubeletExtraArgs:
214-
kube-reserved: cpu=1,memory=2Gi,ephemeral-storage=1Gi
215-
system-reserved: cpu=500m,memory=1Gi,ephemeral-storage=1Gi
216-
eviction-hard: memory.available<500Mi,nodefs.available<10%
217+
- name: kube-reserved
218+
value: "cpu=1,memory=2Gi,ephemeral-storage=1Gi"
219+
- name: system-reserved
220+
value: "cpu=500m,memory=1Gi,ephemeral-storage=1Gi"
221+
- name: eviction-hard
222+
value: "memory.available<500Mi,nodefs.available<10%"
217223
joinConfiguration:
218224
nodeRegistration:
219225
criSocket: unix:///var/run/containerd/containerd.sock
220226
# Set kubelet flags via KubeadmConfigSpec.kubeletExtraArgs
221227
kubeletExtraArgs:
222-
kube-reserved: cpu=1,memory=2Gi,ephemeral-storage=1Gi
223-
system-reserved: cpu=500m,memory=1Gi,ephemeral-storage=1Gi
224-
eviction-hard: memory.available<500Mi,nodefs.available<10%
228+
- name: kube-reserved
229+
value: "cpu=1,memory=2Gi,ephemeral-storage=1Gi"
230+
- name: system-reserved
231+
value: "cpu=500m,memory=1Gi,ephemeral-storage=1Gi"
232+
- name: eviction-hard
233+
value: "memory.available<500Mi,nodefs.available<10%"
225234
```
226235

227236
### KubeadmConfigTemplate
228237

229238
```yaml
230-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
239+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
231240
kind: KubeadmConfigTemplate
232241
metadata:
233242
name: kubelet-extra-args-default-worker-bootstraptemplate
@@ -240,9 +249,12 @@ spec:
240249
criSocket: unix:///var/run/containerd/containerd.sock
241250
# Set kubelet flags via KubeadmConfigSpec.kubeletExtraArgs
242251
kubeletExtraArgs:
243-
kube-reserved: cpu=1,memory=2Gi,ephemeral-storage=1Gi
244-
system-reserved: cpu=500m,memory=1Gi,ephemeral-storage=1Gi
245-
eviction-hard: memory.available<500Mi,nodefs.available<10%
252+
- name: kube-reserved
253+
value: "cpu=1,memory=2Gi,ephemeral-storage=1Gi"
254+
- name: system-reserved
255+
value: "cpu=500m,memory=1Gi,ephemeral-storage=1Gi"
256+
- name: eviction-hard
257+
value: "memory.available<500Mi,nodefs.available<10%"
246258
```
247259

248260
## Use kubeadm's `kubeletconfiguration` patch target
@@ -254,7 +266,7 @@ This method is useful when you want to change the kubelet configuration file par
254266
### KubeadmControlPlaneTemplate
255267

256268
```yaml
257-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
269+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
258270
kind: KubeadmControlPlaneTemplate
259271
metadata:
260272
name: kubeadm-config-template-control-plane
@@ -306,7 +318,7 @@ spec:
306318
### KubeadmConfigTemplate
307319

308320
```yaml
309-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
321+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
310322
kind: KubeadmConfigTemplate
311323
metadata:
312324
name: kubeadm-config-template-default-worker-bootstraptemplate
@@ -346,4 +358,4 @@ spec:
346358
# Here we specify the directory that contains the patch files
347359
patches:
348360
directory: /etc/kubernetes/patches
349-
```
361+
```

docs/book/src/tasks/bootstrap/microk8s-bootstrap.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
The worker nodes are configured through the `MachineDeployment` object:
4242

4343
```yaml
44-
apiVersion: cluster.x-k8s.io/v1beta1
44+
apiVersion: cluster.x-k8s.io/v1beta2
4545
kind: MachineDeployment
4646
metadata:
4747
name: capi-aws-md-0
@@ -57,10 +57,9 @@ spec:
5757
version: v1.23.0
5858
bootstrap:
5959
configRef:
60-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
60+
apiGroup: bootstrap.cluster.x-k8s.io
6161
kind: MicroK8sConfigTemplate
6262
name: capi-aws-md-0
63-
......
6463
---
6564
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
6665
kind: MicroK8sConfigTemplate
@@ -70,6 +69,7 @@ metadata:
7069
spec:
7170
template:
7271
spec: {}
72+
......
7373
```
7474

7575
In both the `MicroK8sControlPlane` and `MicroK8sConfigTemplate` you can set a `MicroK8sConfig` object. In the `MicroK8sControlPlane` case `MicroK8sConfig` is under `MicroK8sConfig.spec.controlPlaneConfig` whereas in `MicroK8sConfigTemplate` it is under `MicroK8sConfigTemplate.spec.template.spec`.

docs/book/src/tasks/certs/auto-rotate-certificates-in-kcp.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ To configure a rollout on the KCP machines you need to set `.rolloutBefore.certi
1010

1111
Example:
1212
```yaml
13-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
13+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
1414
kind: KubeadmControlPlane
1515
metadata:
1616
name: example-control-plane
1717
spec:
18-
rolloutBefore:
19-
certificatesExpiryDays: 21 # trigger a rollout if certificates expire within 21 days
18+
rollout:
19+
before:
20+
certificatesExpiryDays: 21 # trigger a rollout if certificates expire within 21 days
2021
kubeadmConfigSpec:
2122
clusterConfiguration:
2223
...
@@ -25,8 +26,9 @@ spec:
2526
joinConfiguration:
2627
...
2728
machineTemplate:
28-
infrastructureRef:
29-
...
29+
spec:
30+
infrastructureRef:
31+
...
3032
replicas: 1
3133
version: v1.23.3
3234
```
@@ -64,4 +66,4 @@ KubeadmConfig corresponding to the current machine.
6466
</aside>
6567

6668
<!-- links -->
67-
[RFC3339]: https://www.ietf.org/rfc/rfc3339.txt
69+
[RFC3339]: https://www.ietf.org/rfc/rfc3339.txt

docs/book/src/tasks/cluster-resource-set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This can be accomplished by labeling the clusters with the specific cloud (e.g.
1919
For example, you could have the following for OpenStack:
2020

2121
```yaml
22-
apiVersion: addons.cluster.x-k8s.io/v1beta1
22+
apiVersion: addons.cluster.x-k8s.io/v1beta2
2323
kind: ClusterResourceSet
2424
metadata:
2525
name: cloud-provider-openstack

0 commit comments

Comments
 (0)