Skip to content

Commit 3f3b703

Browse files
committed
more review findings + additional fixes
1 parent ca154ad commit 3f3b703

File tree

1 file changed

+34
-14
lines changed

1 file changed

+34
-14
lines changed

docs/book/src/tasks/experimental-features/cluster-class/write-clusterclass.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ ClusterClass is already very flexible. Via the topology on the Cluster the follo
7272
* `.spec.topology.version`: the Kubernetes version of the Cluster
7373
* `.spec.topology.controlPlane`: control plane replicas and their metadata
7474
* `.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>
7782

7883
```yaml
7984
apiVersion: cluster.x-k8s.io/v1beta1
@@ -200,8 +205,12 @@ spec:
200205
example: k8s.gcr.io
201206
```
202207

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>
205214

206215
**Defining patches in the ClusterClass**
207216

@@ -233,14 +242,17 @@ spec:
233242
variable: imageRepository
234243
```
235244

236-
**Notes**:
245+
<aside class="note">
246+
237247
* Only fields below `/spec` can be patched.
238248
* Only `add`, `remove` and `replace` operations are supported.
239249
* It's only possible to append and prepend to arrays. Insertions at a specific index are
240250
not supported.
241251
* Be careful, appending or prepending an array variable to an array leads to a nested array
242252
(for more details please see this [issue](https://github.com/kubernetes-sigs/cluster-api/issues/5944)).
243253

254+
</aside>
255+
244256
**Setting variable values in the Cluster**
245257

246258
After creating a ClusterClass with a variable definition, the user can now provide a value for
@@ -259,9 +271,13 @@ spec:
259271
value: k8s.gcr.io
260272
```
261273

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>
265281

266282
## Advanced features of ClusterClass with patches
267283

@@ -274,11 +290,11 @@ referenced in patches:
274290
- `builtin.cluster.{name,namespace}`
275291
- `builtin.cluster.topology.{version,class}`
276292
- `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.
279295
- `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.
282298

283299
Builtin variables can be referenced just like regular variables, e.g.:
284300
```yaml
@@ -372,12 +388,16 @@ spec:
372388
value: "my.custom.registry"
373389
```
374390
375-
**Paths**
391+
<aside class="note">
392+
393+
<h1>Variable paths</h1>
376394
377395
* Paths can be used in `.valueFrom.template` and `.valueFrom.variable` to access nested fields of arrays and objects.
378396
* `.` is used to access a field of an object, e.g. `httpProxy.url`.
379397
* `[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>
381401

382402
**Tips & Tricks**
383403

0 commit comments

Comments
 (0)