Skip to content

Commit

Permalink
Merge pull request #5838 from sbueringer/pr-update-cc-proposal
Browse files Browse the repository at this point in the history
📖 Update ClusterClass proposal
  • Loading branch information
k8s-ci-robot authored Dec 10, 2021
2 parents c1730d3 + 0b454d6 commit c698e19
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions docs/proposals/202105256-cluster-class-and-managed-topologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ This method of provisioning the cluster would act as a single control point for
We are fully aware that in order to exploit the potential of ClusterClass and managed topologies, the following class of problems still needs to be addressed:
- **Upgrade/rollback strategy**: Implement a strategy to upgrade and rollback the managed topologies.
- **Extensibility/Transformation**:
- Extend ClusterClass patch variables by introducing support for complex types (e.g. object, array, map, type composition (e.g. int or string)).
- Provide an external mechanism which allows to leverage the full power of a programming language to implement more complex customizations.
- **Adoption**: Providing a way to convert existing clusters into managed topologies.
- **Observability**: Build an SDK and enhance the Cluster object status to surface a summary of the status of the topology.
Expand Down Expand Up @@ -325,9 +324,9 @@ type VariableSchema struct{
The schema implementation will be built on top of the [Open API schema embedded in Kubernetes CRDs](https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apis/apiextensions/types_jsonschema.go).
To keep the implementation as easy and user-friendly as possible we will only implement the following feature set
for now (until further use cases emerge):
- Basic types:
- boolean, integer, number, string
- Basic types: boolean, integer, number, string
- Basic validation, e.g. format, minimum, maximum, pattern, required, ...
- Complex types: objects, arrays
- Defaulting
- Defaulting will be implemented based on the CRD structural schema library and thus will have the same feature set
as CRD defaulting. I.e., it will only be possible to use constant values as defaults.
Expand All @@ -341,7 +340,18 @@ for now (until further use cases emerge):
type ClusterClassPatch struct {
// Name of the patch.
Name string `json:"name"`


// Description is a human-readable description of this patch.
Description string `json:"description,omitempty"`

// EnabledIf is a Go template to be used to calculate if a patch should be enabled.
// It can reference variables defined in .spec.variables and builtin variables.
// The patch will be enabled if the template evaluates to `true`, otherwise it will
// be disabled.
// If EnabledIf is not set, the patch will be enabled per default.
// +optional
EnabledIf *string `json:"enabledIf,omitempty"`

// Definitions define the patches inline.
// Note: Patches will be applied in the order of the array.
Definitions []PatchDefinition `json:"definitions,omitempty"`
Expand Down Expand Up @@ -397,14 +407,15 @@ type PatchSelectorMatch struct {
// MachineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in
// .spec.workers.machineDeployments.
// +optional
MachineDeploymentClass PatchSelectorMatchMachineDeploymentClass `json:"machineDeploymentClass,omitempty"`
MachineDeploymentClass *PatchSelectorMatchMachineDeploymentClass `json:"machineDeploymentClass,omitempty"`
}

// PatchSelectorMatchMachineDeploymentClass selects templates referenced
// in specific MachineDeploymentClasses in .spec.workers.machineDeployments.
type PatchSelectorMatchMachineDeploymentClass struct {
// Names selects templates by class names.
Names []string `json:"names"`
// +optional
Names []string `json:"names,omitempty"`
}
```

Expand Down

0 comments on commit c698e19

Please sign in to comment.