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-1Lines changed: 49 additions & 1 deletion
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>
@@ -200,11 +204,14 @@ providers.
200
204
An infrastructure provider could publish a **cluster templates** file to be used by `clusterctl generate cluster`.
201
205
This is single YAML with _all_ the objects required to create a new workload cluster.
202
206
207
+
With ClusterClass enabled it is possible to have cluster templates with managed topologies. Cluster templates with managed
208
+
topologies require only the cluster object in the template and a corresponding ClusterClass definition.
209
+
203
210
The following rules apply:
204
211
205
212
#### Naming conventions
206
213
207
-
Cluster templates MUST be stored in the same folder as the component YAML and follow this naming convention:
214
+
Cluster templates MUST be stored in the same location as the component YAML and follow this naming convention:
208
215
1. The default cluster template should be named `cluster-template.yaml`.
209
216
2. Additional cluster template should be named `cluster-template-{flavor}.yaml`. e.g `cluster-template-prod.yaml`
210
217
@@ -242,6 +249,47 @@ Templates writers should use the common variables to ensure consistency across p
242
249
Additionally, the value of the command argument to `clusterctl generate cluster <cluster-name>` (`<cluster-name>` in this case), will
243
250
be applied to every occurrence of the `${ CLUSTER_NAME }` variable.
244
251
252
+
### ClusterClass definitions
253
+
254
+
An infrastructure provider could publish a **ClusterClass definition** file to be used by `clusterctl generate cluster` that will be used along
255
+
with the workload cluster templates.
256
+
This is a single YAML with _all_ the objects required that make up the ClusterClass.
257
+
258
+
The following rules apply:
259
+
260
+
#### Naming conventions
261
+
262
+
ClusterClass definitions MUST be stored in the same location as the component YAML and follow this naming convention:
263
+
1. The ClusterClass definition should be named `clusterclass-{ClusterClass-name}.yaml`, e.g `clusterclass-prod.yaml`.
264
+
265
+
`{ClusterClass-name}` is the name of the ClusterClass that is referenced from the Cluster.spec.topology.class field
266
+
in the Cluster template; Cluster template files using a ClusterClass are usually simpler because they are no longer
267
+
required to have all the templates.
268
+
269
+
Each provider should create user facing documentation with the list of available ClusterClass definitions.
270
+
271
+
#### Target namespace
272
+
273
+
The ClusterClass definition YAML MUST assume the target namespace already exists.
274
+
275
+
The references in the ClusterClass definition should NOT specify a namespace.
276
+
277
+
It is recommended that none of the objects in the ClusterClass YAML should specify a namespace.
278
+
279
+
Even if technically possible, it is strongly recommended that none of the objects in the ClusterClass definitions are shared across multiple definitions;
280
+
this helps in preventing changing an object inadvertently impacting many ClusterClasses, and consequently, all the Clusters using those ClusterClasses.
281
+
282
+
#### Variables
283
+
284
+
Currently the ClusterClass definitions SHOULD NOT have any environment variables in them.
285
+
286
+
ClusterClass definitions files should not use variable substitution, given that ClusterClass and managed topologies provide an alternative model for variable definition.
287
+
288
+
#### Note
289
+
290
+
A ClusterClass definition is automatically included in the output of `clusterctl generate cluster` if the cluster template uses a managed topology
291
+
and a ClusterClass with the same name does not already exists in the Cluster.
292
+
245
293
## OwnerReferences chain
246
294
247
295
Each provider is responsible to ensure that all the providers resources (like e.g. `VSphereCluster`, `VSphereMachine`, `VSphereVM` etc.
0 commit comments