You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controlplane/controllers/remediation.go
+68-12Lines changed: 68 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ import (
30
30
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
31
31
"sigs.k8s.io/cluster-api/util"
32
32
"sigs.k8s.io/cluster-api/util/annotations"
33
+
"sigs.k8s.io/cluster-api/util/collections"
33
34
"sigs.k8s.io/cluster-api/util/conditions"
34
35
"sigs.k8s.io/cluster-api/util/patch"
35
36
ctrl "sigs.k8s.io/controller-runtime"
@@ -41,7 +42,7 @@ import (
41
42
// reconcileUnhealthyMachines tries to remediate KThreesControlPlane unhealthy machines
42
43
// based on the process described in https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20191017-kubeadm-based-control-plane.md#remediation-using-delete-and-recreate
43
44
// taken from the kubeadm codebase and adapted for the k3s provider.
// The cluster MUST NOT have healthy machines still being provisioned. This rule prevents KCP taking actions while the cluster is in a transitional state.
log.Info("A control plane machine needs remediation, but there are other control-plane machines being provisioned. Skipping remediation")
155
+
conditions.MarkFalse(machineToBeRemediated, clusterv1.MachineOwnerRemediatedCondition, clusterv1.WaitingForRemediationReason, clusterv1.ConditionSeverityWarning, "KCP waiting for control plane machine provisioning to complete before triggering remediation")
156
+
return ctrl.Result{}, nil
157
+
}
158
+
150
159
// The cluster MUST have no machines with a deletion timestamp. This rule prevents KCP taking actions while the cluster is in a transitional state.
151
160
ifcontrolPlane.HasDeletingMachine() {
152
161
log.Info("A control plane machine needs remediation, but there are other control-plane machines being deleted. Skipping remediation")
log.Info("A control plane machine needs remediation, but removing this machine could result in etcd quorum loss. Skipping remediation")
163
176
conditions.MarkFalse(machineToBeRemediated, clusterv1.MachineOwnerRemediatedCondition, clusterv1.WaitingForRemediationReason, clusterv1.ConditionSeverityWarning, "KCP can't remediate this machine because this could result in etcd loosing quorum")
0 commit comments