Skip to content

Commit c3e0ec6

Browse files
authored
Merge pull request #5976 from sbueringer/pr-cc-proposal-md-variables
🌱 ClusterClass: add MD variables to the ClusterClass proposal
2 parents 6e3c35c + ac3ff6a commit c3e0ec6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/proposals/202105256-cluster-class-and-managed-topologies.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,10 @@ Note: Builtin variables are defined in [Builtin variables](#builtin-variables) b
612612
// of this value.
613613
// +optional
614614
Replicas *int `json:"replicas,omitempty"`
615+
616+
// Variables can be used to customize the MachineDeployment through patches.
617+
// +optional
618+
Variables *MachineDeploymentVariables `json:"variables,omitempty"`
615619
}
616620
```
617621
1. The `ClusterVariable` object represents an instance of a variable.
@@ -630,6 +634,16 @@ Note: Builtin variables are defined in [Builtin variables](#builtin-variables) b
630634
}
631635
```
632636

637+
1. The `MachineDeploymentVariables` represents variable overrides for a MachineDeployment topology .
638+
```golang
639+
// MachineDeploymentVariables can be used to provide variables for a specific MachineDeployment.
640+
type MachineDeploymentVariables struct {
641+
// Overrides can be used to override Cluster level variables.
642+
// +optional
643+
Overrides []ClusterVariable `json:"overrides,omitempty"`
644+
}
645+
```
646+
633647
#### Builtin variables
634648

635649
It’s also possible to use so-called builtin variables in addition to user-defined variables. The following builtin variables are available:
@@ -720,6 +734,8 @@ Builtin variables are available under the `builtin.` prefix. Some examples:
720734
- `spec.topology.workers.machineDeployments[i].name` field must be unique within a Cluster
721735
- (defaulting) variables are defaulted according to the corresponding `ClusterClassVariable`
722736
- all required variables must exist and match the schema defined in the corresponding `ClusterClassVariable` in the ClusterClass
737+
- (defaulting) nested fields of `spec.topology.workers.machineDeployments[i].variables.overrides` are defaulted according to the corresponding `ClusterClassVariable`
738+
- `spec.topology.workers.machineDeployments[i].variables.overrides` must match the schema defined in the corresponding `ClusterClassVariable` in the ClusterClass
723739

724740
- For object updates:
725741
- If `spec.topology.class` is set it cannot be unset or modified, and if it's unset it cannot be set.
@@ -729,7 +745,9 @@ Builtin variables are available under the `builtin.` prefix. Some examples:
729745
- A set of worker nodes can be added to or removed from the `spec.topology.workers.machineDeployments` list.
730746
- (defaulting) variables are defaulted according to the corresponding `ClusterClassVariable`
731747
- all required variables must exist and match the schema defined in the corresponding `ClusterClassVariable` in the ClusterClass
732-
748+
- (defaulting) nested fields of `spec.topology.workers.machineDeployments[i].variables.overrides` are defaulted according to the corresponding `ClusterClassVariable`
749+
- `spec.topology.workers.machineDeployments[i].variables.overrides` must match the schema defined in the corresponding `ClusterClassVariable` in the ClusterClass
750+
733751
#### ClusterClass compatibility
734752
735753
There are cases where we must consider whether two ClusterClasses are compatible:
@@ -990,6 +1008,7 @@ to avoid creating separate ClusterClasses for every small deviation, e.g. a diff
9901008
- Calculate patches:
9911009
- evaluate patch selector
9921010
- evaluate patch values
1011+
- if variable overrides are set, they are used instead of the Cluster-level variables.
9931012
- Apply patches to our local copies of the templates.
9941013
<br>**Note**: Patches are applied in the order in which they are defined in the ClusterClass.
9951014

0 commit comments

Comments
 (0)