@@ -92,7 +92,7 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
92
92
// and `MachineOwnerRemediated` is false, indicating that this controller is responsible for performing remediation.
93
93
machinesToBeRemediated := controlPlane .MachinesToBeRemediatedByRCP ()
94
94
95
- // If there are no machines to remediated, return so KCP can proceed with other operations (ctrl.Result nil).
95
+ // If there are no machines to remediated, return so RKE2ControlPlane can proceed with other operations (ctrl.Result nil).
96
96
if len (machinesToBeRemediated ) == 0 {
97
97
return ctrl.Result {}, nil
98
98
}
@@ -120,8 +120,8 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
120
120
// is not being deleted to avoid unnecessary logs if no further remediation should be done.
121
121
if v , ok := controlPlane .RCP .Annotations [controlplanev1 .RemediationInProgressAnnotation ]; ok {
122
122
// Check if the annotation is stale; this might happen in case there is a crash in the controller in between
123
- // when a new Machine is created and the annotation is eventually removed from KCP via defer patch at the end
124
- // of KCP reconcile.
123
+ // when a new Machine is created and the annotation is eventually removed from RKE2ControlPlane via defer patch at the end
124
+ // of RKE2ControlPlane reconcile.
125
125
remediationData , err := RemediationDataFromAnnotation (v )
126
126
if err != nil {
127
127
return ctrl.Result {}, err
@@ -168,9 +168,9 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
168
168
// Before starting remediation, run preflight checks in order to verify it is safe to remediate.
169
169
// If any of the following checks fails, we'll surface the reason in the MachineOwnerRemediated condition.
170
170
171
- // Check if KCP is allowed to remediate considering retry limits:
171
+ // Check if RKE2ControlPlane is allowed to remediate considering retry limits:
172
172
// - Remediation cannot happen because retryPeriod is not yet expired.
173
- // - KCP already reached MaxRetries limit.
173
+ // - RKE2ControlPlane already reached MaxRetries limit.
174
174
remediationInProgressData , canRemediate , err := r .checkRetryLimits (log , machineToBeRemediated , controlPlane , reconciliationTime )
175
175
if err != nil {
176
176
return ctrl.Result {}, err
@@ -181,7 +181,7 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
181
181
return ctrl.Result {}, nil
182
182
}
183
183
184
- // Executes checks that apply only if the control plane is already initialized; in this case KCP can
184
+ // Executes checks that apply only if the control plane is already initialized; in this case RKE2ControlPlane can
185
185
// remediate only if it can safely assume that the operation preserves the operation state of the
186
186
// existing cluster (or at least it doesn't make it worse).
187
187
if controlPlane .RCP .Status .Initialized {
@@ -203,7 +203,7 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
203
203
}
204
204
205
205
// The cluster MUST NOT have healthy machines still being provisioned.
206
- // This rule prevents KCP taking actions while the cluster is in a transitional state.
206
+ // This rule prevents RKE2ControlPlane taking actions while the cluster is in a transitional state.
207
207
if controlPlane .HasHealthyMachineStillProvisioning () {
208
208
log .Info ("A control plane machine needs remediation, but there are other control-plane machines being provisioned. Skipping remediation" )
209
209
conditions .MarkFalse (
@@ -217,7 +217,7 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
217
217
return ctrl.Result {}, nil
218
218
}
219
219
220
- // The cluster MUST have no machines with a deletion timestamp. This rule prevents KCP taking actions while the cluster is in a transitional state.
220
+ // The cluster MUST have no machines with a deletion timestamp. This rule prevents RKE2ControlPlane taking actions while the cluster is in a transitional state.
221
221
if controlPlane .HasDeletingMachine () {
222
222
log .Info ("A control plane machine needs remediation, but there are other control-plane machines being deleted. Skipping remediation" )
223
223
conditions .MarkFalse (
@@ -231,7 +231,7 @@ func (r *RKE2ControlPlaneReconciler) reconcileUnhealthyMachines(ctx context.Cont
231
231
return ctrl.Result {}, nil
232
232
}
233
233
234
- // Remediation MUST preserve etcd quorum. This rule ensures that KCP will not remove a member that would result in etcd
234
+ // Remediation MUST preserve etcd quorum. This rule ensures that RKE2ControlPlane will not remove a member that would result in etcd
235
235
// losing a majority of members and thus become unable to field new requests.
236
236
if controlPlane .IsEtcdManaged () {
237
237
canSafelyRemediate , err := r .canSafelyRemoveEtcdMember (ctx , controlPlane , machineToBeRemediated )
@@ -433,9 +433,9 @@ func pickMachineToBeRemediatedByConditionState(i, j *clusterv1.Machine, t cluste
433
433
return nil
434
434
}
435
435
436
- // checkRetryLimits checks if KCP is allowed to remediate considering retry limits:
436
+ // checkRetryLimits checks if RKE2ControlPlane is allowed to remediate considering retry limits:
437
437
// - Remediation cannot happen because retryPeriod is not yet expired.
438
- // - KCP already reached the maximum number of retries for a machine.
438
+ // - RKE2ControlPlane already reached the maximum number of retries for a machine.
439
439
// NOTE: Counting the number of retries is required In order to prevent infinite remediation e.g. in case the
440
440
// first Control Plane machine is failing due to quota issue.
441
441
func (r * RKE2ControlPlaneReconciler ) checkRetryLimits (
@@ -489,7 +489,7 @@ func (r *RKE2ControlPlaneReconciler) checkRetryLimits(
489
489
}
490
490
491
491
// Once we get here we already know that there was a last remediation for the Machine.
492
- // If the current remediation is happening before minHealthyPeriod is expired, then KCP considers this
492
+ // If the current remediation is happening before minHealthyPeriod is expired, then RKE2ControlPlane considers this
493
493
// as a remediation for the same previously unhealthy machine.
494
494
// NOTE: If someone/something changes the RemediationForAnnotation on Machines (e.g. changes the Timestamp),
495
495
// this could potentially lead to executing more retries than expected, but this is considered acceptable in such a case.
@@ -624,9 +624,9 @@ func (r *RKE2ControlPlaneReconciler) canSafelyRemoveEtcdMember(ctx context.Conte
624
624
}
625
625
626
626
// If an etcd member does not have a corresponding machine it is not possible to retrieve etcd member health,
627
- // so KCP is assuming the worst scenario and considering the member unhealthy.
627
+ // so RKE2ControlPlane is assuming the worst scenario and considering the member unhealthy.
628
628
//
629
- // NOTE: This should not happen given that KCP is running reconcileEtcdMembers before calling this method.
629
+ // NOTE: This should not happen given that RKE2ControlPlane is running reconcileEtcdMembers before calling this method.
630
630
if machine == nil {
631
631
log .Info ("An etcd member does not have a corresponding machine, assuming this member is unhealthy" , "memberName" , etcdMember )
632
632
targetUnhealthyMembers ++
@@ -663,7 +663,7 @@ func (r *RKE2ControlPlaneReconciler) canSafelyRemoveEtcdMember(ctx context.Conte
663
663
return canSafelyRemediate , nil
664
664
}
665
665
666
- // RemediationData struct is used to keep track of information stored in the RemediationInProgressAnnotation in KCP
666
+ // RemediationData struct is used to keep track of information stored in the RemediationInProgressAnnotation in RKE2ControlPlane
667
667
// during remediation and then into the RemediationForAnnotation on the replacement machine once it is created.
668
668
type RemediationData struct {
669
669
// machine is the machine name of the latest machine being remediated.
0 commit comments