Skip to content

Commit ec5f9ca

Browse files
committed
fix review findings
Signed-off-by: Stefan Büringer [email protected]
1 parent 9f11497 commit ec5f9ca

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ general and how they can be written in a way that they are flexible enough to su
2121
## Basic ClusterClass
2222

2323
The following example shows a basic ClusterClass. It contains templates to shape the control plane,
24-
infrastructure and workers of a Cluster. When a Cluster is using this ClusterClass, the templates
24+
infrastructure and workers of a Cluster. When a Cluster is using this ClusterClass, the templates
2525
are used to generate the objects of the managed topology of the Cluster.
2626

2727
```yaml
@@ -88,16 +88,20 @@ spec:
8888
controlPlane:
8989
replicas: 3
9090
metadata:
91-
labels: {}
92-
annotations: {}
91+
labels:
92+
cpLabel: cpLabelValue
93+
annotations:
94+
cpAnnotation: cpAnnotationValue
9395
workers:
9496
machineDeployments:
9597
- class: default-worker
9698
name: md-0
9799
replicas: 4
98100
metadata:
99-
labels: {}
100-
annotations: {}
101+
labels:
102+
mdLabel: mdLabelValue
103+
annotations:
104+
mdAnnotation: mdAnnotationValue
101105
failureDomain: region
102106
```
103107

@@ -350,6 +354,9 @@ spec:
350354
valueFrom:
351355
# This template is first rendered with Go templating, then parsed by
352356
# a YAML/JSON parser and then used as value of the JSON patch.
357+
# For example, if the variable etcdImageTag is set to `3.5.1-0` the
358+
# .../clusterConfiguration/etcd field will be set to:
359+
# {"local": {"imageTag": "3.5.1-0"}}
353360
template: |
354361
local:
355362
imageTag: {{ .etcdImageTag }}
@@ -524,10 +531,22 @@ spec:
524531
names:
525532
- default-worker
526533
jsonPatches:
527-
- op: replace
534+
- op: add
528535
path: /spec/template/spec/instanceType
529536
valueFrom:
530537
variable: workerMachineType
538+
---
539+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
540+
kind: AWSMachineTemplate
541+
metadata:
542+
name: aws-clusterclass-v0.1.0-default-worker
543+
spec:
544+
template:
545+
spec:
546+
# instanceType: workerMachineType will be set by the patch.
547+
iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io"
548+
---
549+
...
531550
```
532551

533552
In the Cluster resource the `workerMachineType` variable can then be set cluster-wide and

0 commit comments

Comments
 (0)