Skip to content

Commit 42bc0a6

Browse files
Add v1beta2 OwnerRemediated condition to KCP
# Conflicts: # controlplane/kubeadm/api/v1beta1/v1beta2_condition_consts.go
1 parent b03a2d2 commit 42bc0a6

File tree

5 files changed

+263
-30
lines changed

5 files changed

+263
-30
lines changed

api/v1beta1/machine_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const (
104104

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

110110
// Machine's Ready condition and corresponding reasons that will be used in v1Beta2 API version.

api/v1beta1/v1beta2_condition_consts.go

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ const (
8787

8888
// Reasons that are used across different objects.
8989
const (
90+
// AvailableV1Beta2Reason applies to a condition surfacing object availability.
91+
AvailableV1Beta2Reason = "Available"
92+
9093
// InvalidConditionReportedV1Beta2Reason applies to a condition, usually read from an external object, that is invalid
9194
// (e.g. its status is missing).
9295
InvalidConditionReportedV1Beta2Reason = "InvalidConditionReported"

controlplane/kubeadm/api/v1beta1/v1beta2_condition_consts.go

+61-1
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,101 @@ 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 include: certificate authorities for ca, sa, front-proxy, etcd, and if external etcd is used,
39+
// also the apiserver-etcd-client client certificate.
40+
KubeadmControlPlaneCertificatesAvailableV1Beta2Reason = clusterv1.AvailableV1Beta2Reason
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 started.
90+
KubeadmControlPlaneMachineCannotBeRemediatedV1Beta2Reason = "CannotBeRemediated"
91+
92+
// KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason surfaces when remediation of a control plane machine must be deferred.
93+
KubeadmControlPlaneMachineRemediationDeferredV1Beta2Reason = "RemediationDeferred"
94+
95+
// KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason surfaces when remediation of a control plane machine
96+
// has been completed by deleting the unhealthy machine.
97+
// Note: After an unhealthy machine is deleted, a new one is created by the KubeadmControlPlaneMachine as part of the
98+
// regular reconcile loop that ensures the correct number of replicas exist; KubeadmControlPlane machine waits for
99+
// the new machine to exists before removing the controlplane.cluster.x-k8s.io/remediation-in-progress annotation.
100+
// This is part of a series of safeguards to ensure that operation are performed sequentially on control plane machines.
101+
KubeadmControlPlaneMachineRemediationMachineDeletedV1Beta2Reason = "MachineDeleted"
102+
)
51103

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

110+
// KubeadmControlPlane's Paused condition and corresponding reasons that will be used in v1Beta2 API version.
111+
const (
112+
// KubeadmControlPlanePausedV1Beta2Condition is true if this resource or the Cluster it belongs to are paused.
113+
KubeadmControlPlanePausedV1Beta2Condition = clusterv1.PausedV1Beta2Condition
114+
)
115+
56116
// Conditions that will be used for the KubeadmControlPlane controlled machines in v1Beta2 API version.
57117
const (
58118
// KubeadmControlPlaneMachineAPIServerPodHealthyV1Beta2Condition surfaces the status of the API server pod hosted on a KubeadmControlPlane controlled machine.

0 commit comments

Comments
 (0)