@@ -72,8 +72,13 @@ ClusterClass is already very flexible. Via the topology on the Cluster the follo
72
72
* `.spec.topology.version`: the Kubernetes version of the Cluster
73
73
* `.spec.topology.controlPlane`: control plane replicas and their metadata
74
74
* `.spec.topology.workers`: MachineDeployments and their replicas, metadata and failure domain
75
- * **Note**: It's possible to create MachineDeployments with different configurations, by
76
- defining multiple MachineDeployment classes in the ClusterClass.
75
+
76
+ <aside class="note">
77
+
78
+ It's possible to create MachineDeployments with different configurations, by
79
+ defining multiple MachineDeployment classes in the ClusterClass.
80
+
81
+ </aside>
77
82
78
83
` ` ` yaml
79
84
apiVersion: cluster.x-k8s.io/v1beta1
@@ -200,8 +205,12 @@ spec:
200
205
example: k8s.gcr.io
201
206
` ` `
202
207
203
- **Note**: The following basic types are supported: `string`, `integer`, `number` and `boolean`. Complex types
204
- are also supported (please see the corresponding section below).
208
+ <aside class="note">
209
+
210
+ The following basic types are supported : ` string` , `integer`, `number` and `boolean`. We are also
211
+ supporting complex types, please see the [complex variables](#complex-variables) section.
212
+
213
+ </aside>
205
214
206
215
**Defining patches in the ClusterClass**
207
216
@@ -233,14 +242,17 @@ spec:
233
242
variable: imageRepository
234
243
` ` `
235
244
236
- **Notes**:
245
+ <aside class="note">
246
+
237
247
* Only fields below `/spec` can be patched.
238
248
* Only `add`, `remove` and `replace` operations are supported.
239
249
* It's only possible to append and prepend to arrays. Insertions at a specific index are
240
250
not supported.
241
251
* Be careful, appending or prepending an array variable to an array leads to a nested array
242
252
(for more details please see this [issue](https://github.com/kubernetes-sigs/cluster-api/issues/5944)).
243
253
254
+ </aside>
255
+
244
256
**Setting variable values in the Cluster**
245
257
246
258
After creating a ClusterClass with a variable definition, the user can now provide a value for
@@ -259,9 +271,13 @@ spec:
259
271
value: k8s.gcr.io
260
272
` ` `
261
273
262
- **Note**: If the user does not set the value, the variable is automatically added with its
263
- default value by the Cluster webhook, as specified in the corresponding variable
264
- definition in the ClusterClass.
274
+ <aside class="note">
275
+
276
+ If the user does not set the value, the variable is automatically added with its
277
+ default value by the Cluster webhook, as specified in the corresponding variable
278
+ definition in the ClusterClass.
279
+
280
+ </aside>
265
281
266
282
# # Advanced features of ClusterClass with patches
267
283
@@ -274,11 +290,11 @@ referenced in patches:
274
290
- ` builtin.cluster.{name,namespace}`
275
291
- ` builtin.cluster.topology.{version,class}`
276
292
- ` builtin.controlPlane.{replicas,version}`
277
- - **Note**: These variables are only available when patching control plane or control plane
278
- machine templates.
293
+ - Please note, these variables are only available when patching control plane or control plane
294
+ machine templates.
279
295
- ` builtin.machineDeployment.{replicas,version,class,name,topologyName}`
280
- - **Note**: These variables are only available when patching the templates of a MachineDeployment
281
- and contain the values of the current `MachineDeploymentTopology` .
296
+ - Please note, these variables are only available when patching the templates of a MachineDeployment
297
+ and contain the values of the current `MachineDeployment` topology .
282
298
283
299
Builtin variables can be referenced just like regular variables, e.g. :
284
300
` ` ` yaml
@@ -372,12 +388,16 @@ spec:
372
388
value : " my.custom.registry"
373
389
` ` `
374
390
375
- **Paths**
391
+ <aside class="note">
392
+
393
+ <h1>Variable paths</h1>
376
394
377
395
* Paths can be used in ` .valueFrom.template` and `.valueFrom.variable` to access nested fields of arrays and objects.
378
396
* `.` is used to access a field of an object, e.g. `httpProxy.url`.
379
397
* `[i]` is used to access an array element, e.g. `dnsServers[0]`.
380
- * Because of how Go templates work, the paths in templates have a leading `.`.
398
+ * Because of the way Go templates work, the paths in templates have to start with a dot.
399
+
400
+ </aside>
381
401
382
402
**Tips & Tricks**
383
403
0 commit comments