Skip to content

✨ Add Availability and ReadinessGates to ClusterClass #11868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions api/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ type ClusterSpec struct {

// availabilityGates specifies additional conditions to include when evaluating Cluster Available condition.
//
// If this field is not defined and the Cluster implements a managed topology, availabilityGates
// from the corresponding ClusterClass will be used, if any.
//
// NOTE: this field is considered only for computing v1beta2 conditions.
// +optional
// +listType=map
Expand Down Expand Up @@ -594,6 +597,22 @@ type ControlPlaneTopology struct {
// +optional
NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"`

// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
//
// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
//
// If this field is not defined, readinessGates from the corresponding ControlPlaneClass will be used, if any.
//
// NOTE: This field is considered only for computing v1beta2 conditions.
// NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates;
// e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
// +optional
// +listType=map
// +listMapKey=conditionType
// +kubebuilder:validation:MaxItems=32
ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"`

// variables can be used to customize the ControlPlane through patches.
// +optional
Variables *ControlPlaneVariables `json:"variables,omitempty"`
Expand Down Expand Up @@ -674,6 +693,20 @@ type MachineDeploymentTopology struct {
// +optional
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`

// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
//
// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
//
// If this field is not defined, readinessGates from the corresponding MachineDeploymentClass will be used, if any.
//
// NOTE: This field is considered only for computing v1beta2 conditions.
// +optional
// +listType=map
// +listMapKey=conditionType
// +kubebuilder:validation:MaxItems=32
ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"`

// strategy is the deployment strategy to use to replace existing machines with
// new ones.
// +optional
Expand Down
41 changes: 41 additions & 0 deletions api/v1beta1/clusterclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ type ClusterClass struct {

// ClusterClassSpec describes the desired state of the ClusterClass.
type ClusterClassSpec struct {
// availabilityGates specifies additional conditions to include when evaluating Cluster Available condition.
//
// NOTE: this field is considered only for computing v1beta2 conditions.
// NOTE: If a Cluster is using this ClusterClass, and this Cluster defines a custom list of availabilityGates,
// such list overrides availabilityGates defined in this field.
// +optional
// +listType=map
// +listMapKey=conditionType
// +kubebuilder:validation:MaxItems=32
AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"`

// infrastructure is a reference to a provider-specific template that holds
// the details for provisioning infrastructure specific cluster
// for the underlying provider.
Expand Down Expand Up @@ -165,6 +176,22 @@ type ControlPlaneClass struct {
// NOTE: This value can be overridden while defining a Cluster.Topology.
// +optional
NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"`

// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
//
// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
//
// NOTE: This field is considered only for computing v1beta2 conditions.
// NOTE: If a Cluster defines a custom list of readinessGates for the control plane,
// such list overrides readinessGates defined in this field.
// NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates;
// e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
// +optional
// +listType=map
// +listMapKey=conditionType
// +kubebuilder:validation:MaxItems=32
ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"`
}

// ControlPlaneClassNamingStrategy defines the naming strategy for control plane objects.
Expand Down Expand Up @@ -250,6 +277,20 @@ type MachineDeploymentClass struct {
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`

// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
//
// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
//
// NOTE: This field is considered only for computing v1beta2 conditions.
// NOTE: If a Cluster defines a custom list of readinessGates for a MachineDeployment using this MachineDeploymentClass,
// such list overrides readinessGates defined in this field.
// +optional
// +listType=map
// +listMapKey=conditionType
// +kubebuilder:validation:MaxItems=32
ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"`

// strategy is the deployment strategy to use to replace existing machines with
// new ones.
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
Expand Down
25 changes: 25 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading