Skip to content

Commit 141601b

Browse files
author
Yuvaraj Kakaraparthi
committed
update clusterctl provider contract with clusterclass support
1 parent 1b2a319 commit 141601b

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

docs/book/src/clusterctl/provider-contract.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Additionally, the provider repository SHOULD contain the following files:
1616

1717
* Workload cluster templates
1818

19+
Optionally, the provider repository can include the following files:
20+
21+
* ClusterClass definitions
22+
1923
<aside class="note">
2024

2125
<h1> Pre-defined list of providers </h1>
@@ -199,11 +203,14 @@ providers.
199203
An infrastructure provider could publish a **cluster templates** file to be used by `clusterctl generate cluster`.
200204
This is single YAML with _all_ the objects required to create a new workload cluster.
201205

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+
202209
The following rules apply:
203210

204211
#### Naming conventions
205212

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:
207214
1. The default cluster template should be named `cluster-template.yaml`.
208215
2. Additional cluster template should be named `cluster-template-{flavor}.yaml`. e.g `cluster-template-prod.yaml`
209216

@@ -241,6 +248,47 @@ Templates writers should use the common variables to ensure consistency across p
241248
Additionally, the value of the command argument to `clusterctl generate cluster <cluster-name>` (`<cluster-name>` in this case), will
242249
be applied to every occurrence of the `${ CLUSTER_NAME }` variable.
243250

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+
244292
## OwnerReferences chain
245293

246294
Each provider is responsible to ensure that all the providers resources (like e.g. `VSphereCluster`, `VSphereMachine`, `VSphereVM` etc.

0 commit comments

Comments
 (0)