You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/clusterctl/provider-contract.md
+49-1
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@ Additionally, the provider repository SHOULD contain the following files:
16
16
17
17
* Workload cluster templates
18
18
19
+
Optionally, the provider repository can include the following files:
20
+
21
+
* ClusterClass definitions
22
+
19
23
<asideclass="note">
20
24
21
25
<h1> Pre-defined list of providers </h1>
@@ -199,11 +203,14 @@ providers.
199
203
An infrastructure provider could publish a **cluster templates** file to be used by `clusterctl generate cluster`.
200
204
This is single YAML with _all_ the objects required to create a new workload cluster.
201
205
206
+
With ClusterClass enabled it is possible to have cluster templates with managed topologies. Cluster templates with managed
207
+
topologies require only the cluster object in the template and a corresponding ClusterClass definition.
208
+
202
209
The following rules apply:
203
210
204
211
#### Naming conventions
205
212
206
-
Cluster templates MUST be stored in the same folder as the component YAML and follow this naming convention:
213
+
Cluster templates MUST be stored in the same location as the component YAML and follow this naming convention:
207
214
1. The default cluster template should be named `cluster-template.yaml`.
208
215
2. Additional cluster template should be named `cluster-template-{flavor}.yaml`. e.g `cluster-template-prod.yaml`
209
216
@@ -241,6 +248,47 @@ Templates writers should use the common variables to ensure consistency across p
241
248
Additionally, the value of the command argument to `clusterctl generate cluster <cluster-name>` (`<cluster-name>` in this case), will
242
249
be applied to every occurrence of the `${ CLUSTER_NAME }` variable.
243
250
251
+
### ClusterClass definitions
252
+
253
+
An infrastructure provider could publish a **ClusterClass definition** file to be used by `clusterctl generate cluster` that will be used along
254
+
with the workload cluster templates.
255
+
This is a single YAML with _all_ the objects required that make up the ClusterClass.
256
+
257
+
The following rules apply:
258
+
259
+
#### Naming conventions
260
+
261
+
ClusterClass definitions MUST be stored in the same location as the component YAML and follow this naming convention:
262
+
1. The ClusterClass definition should be named `clusterclass-{ClusterClass-name}.yaml`, e.g `clusterclass-prod.yaml`.
263
+
264
+
`{ClusterClass-name}` is the name of the ClusterClass that is referenced from the Cluster.spec.topology.class field
265
+
in the Cluster template; Cluster template files using a ClusterClass are usually simpler because they are no longer
266
+
required to have all the templates.
267
+
268
+
Each provider should create user facing documentation with the list of available ClusterClass definitions.
269
+
270
+
#### Target namespace
271
+
272
+
The ClusterClass definition YAML MUST assume the target namespace already exists.
273
+
274
+
The references in the ClusterClass definition should NOT specify a namespace.
275
+
276
+
It is recommended that none of the objects in the ClusterClass YAML should specify a namespace.
277
+
278
+
Even if technically possible, it is strongly recommended that none of the objects in the ClusterClass definitions are shared across multiple definitions;
279
+
this helps in preventing changing an object inadvertently impacting many ClusterClasses, and consequently, all the Clusters using those ClusterClasses.
280
+
281
+
#### Variables
282
+
283
+
Currently the ClusterClass definitions SHOULD NOT have any environment variables in them.
284
+
285
+
ClusterClass definitions files should not use variable substitution, given that ClusterClass and managed topologies provide an alternative model for variable definition.
286
+
287
+
#### Note
288
+
289
+
A ClusterClass definition is automatically included in the output of `clusterctl generate cluster` if the cluster template uses a managed topology
290
+
and a ClusterClass with the same name does not already exists in the Cluster.
291
+
244
292
## OwnerReferences chain
245
293
246
294
Each provider is responsible to ensure that all the providers resources (like e.g. `VSphereCluster`, `VSphereMachine`, `VSphereVM` etc.
0 commit comments