Skip to content

Commit 57d81ed

Browse files
Add v1beta2 OwnerRemediated condition to KCP
1 parent ff13a64 commit 57d81ed

File tree

3 files changed

+260
-29
lines changed

3 files changed

+260
-29
lines changed

controlplane/kubeadm/api/v1beta1/v1beta2_condition_consts.go

+61-1
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,100 @@ package v1beta1
1818

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

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

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

33+
// KubeadmControlPlaneCertificatesInternalErrorV1Beta2Reason surfaces unexpected failures when reconciling cluster certificates.
34+
KubeadmControlPlaneCertificatesInternalErrorV1Beta2Reason = clusterv1.InternalErrorV1Beta2Reason
35+
36+
// KubeadmControlPlaneCertificatesAvailableV1Beta2Reason surfaces when cluster certificates are available,
37+
// no matter if those certificates have been provided by the user or generated by KubeadmControlPlane itself.
38+
// Cluster certificates includes: certificates authorities for ca, sa, front-proxy, etcd, and if external etcd is used,
39+
// also the apiserver-etcd-client client certificate.
40+
KubeadmControlPlaneCertificatesAvailableV1Beta2Reason = clusterv1.AvailableV1Beta2Condition
41+
)
42+
43+
// KubeadmControlPlane's EtcdClusterAvailable condition and corresponding reasons that will be used in v1Beta2 API version.
44+
const (
3045
// KubeadmControlPlaneEtcdClusterAvailableV1Beta2Condition surfaces issues to the managed etcd cluster, if any.
3146
// It is computed as aggregation of Machines's EtcdMemberHealthy (if not using an external etcd) conditions plus
3247
// additional checks validating potential issues to etcd quorum.
3348
KubeadmControlPlaneEtcdClusterAvailableV1Beta2Condition = "EtcdClusterAvailable"
49+
)
3450

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

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

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

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

77+
// KubeadmControlPlane's Remediating condition and corresponding reasons that will be used in v1Beta2 API version.
78+
const (
4979
// KubeadmControlPlaneRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any.
5080
KubeadmControlPlaneRemediatingV1Beta2Condition = clusterv1.RemediatingV1Beta2Condition
81+
)
82+
83+
// Reasons that will be used for the OwnerRemediated condition set by MachineHealthCheck on KubeadmControlPlane controlled machines
84+
// being remediated in v1Beta2 API version.
85+
const (
86+
// KubeadmControlPlaneMachineRemediationInternalErrorV1Beta2Reason surfaces unexpected failures while remediation a control plane machine.
87+
KubeadmControlPlaneMachineRemediationInternalErrorV1Beta2Reason = clusterv1.InternalErrorV1Beta2Reason
88+
89+
// KubeadmControlPlaneMachineCannotBeRemediatedV1Beta2Reason surfaces when remediation of a control plane machine can't be completed.
90+
KubeadmControlPlaneMachineCannotBeRemediatedV1Beta2Reason = "CannotRemediate"
91+
92+
// KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason surfaces when remediation of a control plane machine must be deferred.
93+
KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason = "RemediationDeferred"
5194

95+
// KubeadmControlPlaneMachineRemediationDoneV1Beta2Reason surfaces when remediation of a control plane machine has been completed.
96+
// Note: After an unhealthy machine is deleted, a new one is created by the KubeadmControlPlaneMachine as part of the
97+
// regular reconcile loop that ensures the correct number of replicas exist; KubeadmControlPlaneMachine waits for
98+
// the new machine to exists before removing the controlplane.cluster.x-k8s.io/remediation-in-progress annotation.
99+
// This is part of a series of safeguards to ensure that operation are performed sequentially on control plane machines.
100+
KubeadmControlPlaneMachineRemediationDoneV1Beta2Reason = "MachineDeleted"
101+
102+
// KubeadmControlPlaneMachineRemediationDInternalErrorV1Beta2Reason surfaces unexpected failures when remediating
103+
// a KubeadmControlPlane controlled machine.
104+
KubeadmControlPlaneMachineRemediationDInternalErrorV1Beta2Reason = clusterv1.InternalErrorV1Beta2Reason
105+
)
106+
107+
// KubeadmControlPlane's Deleting condition and corresponding reasons that will be used in v1Beta2 API version.
108+
const (
52109
// KubeadmControlPlaneDeletingV1Beta2Condition surfaces details about ongoing deletion of the controlled machines.
53110
KubeadmControlPlaneDeletingV1Beta2Condition = clusterv1.DeletingV1Beta2Condition
111+
)
54112

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

0 commit comments

Comments
 (0)