Skip to content
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

✨ Add v1beta2 OwnerRemediated condition to KCP #11297

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
2 changes: 1 addition & 1 deletion api/v1beta1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const (

// MachineAvailableV1Beta2Reason surfaces when a machine is ready for at least MinReadySeconds.
// Note: MinReadySeconds is assumed 0 until it will be implemented in v1beta2 API.
MachineAvailableV1Beta2Reason = AvailableV1Beta2Condition
MachineAvailableV1Beta2Reason = AvailableV1Beta2Reason
)

// Machine's Ready condition and corresponding reasons that will be used in v1Beta2 API version.
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/v1beta2_condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ const (

// Reasons that are used across different objects.
const (
// AvailableV1Beta2Reason applies to a condition surfacing object availability.
AvailableV1Beta2Reason = "Available"

// InvalidConditionReportedV1Beta2Reason applies to a condition, usually read from an external object, that is invalid
// (e.g. its status is missing).
InvalidConditionReportedV1Beta2Reason = "InvalidConditionReported"
Expand Down
62 changes: 61 additions & 1 deletion controlplane/kubeadm/api/v1beta1/v1beta2_condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,101 @@ package v1beta1

import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

// Conditions that will be used for the KubeadmControlPlane object in v1Beta2 API version.
// KubeadmControlPlane's Available condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneAvailableV1Beta2Condition True if the control plane can be reached, EtcdClusterAvailable is true,
// and CertificatesAvailable is true.
KubeadmControlPlaneAvailableV1Beta2Condition = clusterv1.AvailableV1Beta2Condition
)

// KubeadmControlPlane's CertificatesAvailable condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneCertificatesAvailableV1Beta2Condition True if all the cluster certificates exist.
KubeadmControlPlaneCertificatesAvailableV1Beta2Condition = "CertificatesAvailable"

// KubeadmControlPlaneCertificatesInternalErrorV1Beta2Reason surfaces unexpected failures when reconciling cluster certificates.
KubeadmControlPlaneCertificatesInternalErrorV1Beta2Reason = clusterv1.InternalErrorV1Beta2Reason

// KubeadmControlPlaneCertificatesAvailableV1Beta2Reason surfaces when cluster certificates are available,
// no matter if those certificates have been provided by the user or generated by KubeadmControlPlane itself.
// Cluster certificates include: certificate authorities for ca, sa, front-proxy, etcd, and if external etcd is used,
// also the apiserver-etcd-client client certificate.
KubeadmControlPlaneCertificatesAvailableV1Beta2Reason = clusterv1.AvailableV1Beta2Reason
)

// KubeadmControlPlane's EtcdClusterAvailable condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneEtcdClusterAvailableV1Beta2Condition surfaces issues to the managed etcd cluster, if any.
// It is computed as aggregation of Machines's EtcdMemberHealthy (if not using an external etcd) conditions plus
// additional checks validating potential issues to etcd quorum.
KubeadmControlPlaneEtcdClusterAvailableV1Beta2Condition = "EtcdClusterAvailable"
)

// KubeadmControlPlane's MachinesReady condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any.
// Please note this will include also APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy conditions.
// If not using an external etcd also EtcdPodHealthy, EtcdMemberHealthy conditions are included.
KubeadmControlPlaneMachinesReadyV1Beta2Condition = clusterv1.MachinesReadyV1Beta2Condition
)

// KubeadmControlPlane's MachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneMachinesUpToDateV1Beta2Condition surfaces details of controlled machines not up to date, if any.
KubeadmControlPlaneMachinesUpToDateV1Beta2Condition = clusterv1.MachinesUpToDateV1Beta2Condition
)

// KubeadmControlPlane's ScalingUp condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneScalingUpV1Beta2Condition is true if available replicas < desired replicas.
KubeadmControlPlaneScalingUpV1Beta2Condition = clusterv1.ScalingUpV1Beta2Condition
)

// KubeadmControlPlane's ScalingDown condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneScalingDownV1Beta2Condition is true if replicas > desired replicas.
KubeadmControlPlaneScalingDownV1Beta2Condition = clusterv1.ScalingDownV1Beta2Condition
)

// KubeadmControlPlane's Remediating condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any.
KubeadmControlPlaneRemediatingV1Beta2Condition = clusterv1.RemediatingV1Beta2Condition
)

// Reasons that will be used for the OwnerRemediated condition set by MachineHealthCheck on KubeadmControlPlane controlled machines
// being remediated in v1Beta2 API version.
const (
// KubeadmControlPlaneMachineRemediationInternalErrorV1Beta2Reason surfaces unexpected failures while remediation a control plane machine.
KubeadmControlPlaneMachineRemediationInternalErrorV1Beta2Reason = clusterv1.InternalErrorV1Beta2Reason

// KubeadmControlPlaneMachineCannotBeRemediatedV1Beta2Reason surfaces when remediation of a control plane machine can't be started.
KubeadmControlPlaneMachineCannotBeRemediatedV1Beta2Reason = "CannotBeRemediated"

// KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason surfaces when remediation of a control plane machine must be deferred.
KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason = "RemediationDeferred"

// KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason surfaces when remediation of a control plane machine
// has been completed by deleting the unhealthy machine.
// Note: After an unhealthy machine is deleted, a new one is created by the KubeadmControlPlaneMachine as part of the
// regular reconcile loop that ensures the correct number of replicas exist; KubeadmControlPlane machine waits for
// the new machine to exists before removing the controlplane.cluster.x-k8s.io/remediation-in-progress annotation.
// This is part of a series of safeguards to ensure that operation are performed sequentially on control plane machines.
KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason = "MachineDeleted"
)

// KubeadmControlPlane's Deleting condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlaneDeletingV1Beta2Condition surfaces details about ongoing deletion of the controlled machines.
KubeadmControlPlaneDeletingV1Beta2Condition = clusterv1.DeletingV1Beta2Condition
)

// KubeadmControlPlane's Paused condition and corresponding reasons that will be used in v1Beta2 API version.
const (
// KubeadmControlPlanePausedV1Beta2Condition is true if this resource or the Cluster it belongs to are paused.
KubeadmControlPlanePausedV1Beta2Condition = clusterv1.PausedV1Beta2Condition
)

// Conditions that will be used for the KubeadmControlPlane controlled machines in v1Beta2 API version.
const (
// KubeadmControlPlaneMachineAPIServerPodHealthyV1Beta2Condition surfaces the status of the API server pod hosted on a KubeadmControlPlane controlled machine.
Expand Down
Loading