-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ KCP remediates unhealthy machines #3830
✨ KCP remediates unhealthy machines #3830
Conversation
The implementation should be completed so people can review (thanks in advance for feedback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit suggestions
controlplane/kubeadm/internal/machinefilters/machine_filters.go
Outdated
Show resolved
Hide resolved
logger.Info("A control plane machine needs remediation, but the current number of replicas is currently lower that expected. Skipping remediation", "UnhealthyMachine", machineToBeRemediated.Name, "Replicas", desiredReplicas, "CurrentReplicas", c.Machines.Len()) | ||
conditions.MarkFalse(machineToBeRemediated, clusterv1.MachineOwnerRemediatedCondition, clusterv1.WaitingForRemediationReason, clusterv1.ConditionSeverityWarning, "KCP waiting for having at least %d control plane machines before triggering remediation", desiredReplicas) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidenote, it'd be great to have the conditions functions to log things out for us
/milestone v0.3.11 |
@vincepri @sedefsavas thanks for the feedback! /hold cancel |
/test pull-cluster-api-test-release-0-3 |
/hold |
364c34b
to
8d76ecc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits.
I will LGTM after it is approved.
|
||
defer func() { | ||
// Always attempt to Patch the Machine conditions after each reconcileUnhealthyMachines. | ||
if err := patchHelper.Patch(ctx, machineToBeRemediated, patch.WithOwnedConditions{Conditions: []clusterv1.ConditionType{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit.
WithOwnedConditions
is deprecated, is there another way to use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I'm keeping the same approach we are using in the other controllers (WithOwnedConditions), but soon or later we should switch everything to WithForceOverwriteConditions
unless we finally switch to server side apply.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should un-deprecate it, we shouldn't use WithForceOverwriteConditions
here
FYI, the documented process in CONTRIBUTING.md is that LGTM is supposed to come before approval. |
8d76ecc
to
269290a
Compare
/hold cancel |
269290a
to
4d6b7d7
Compare
/ hold |
32b4bde
to
fbd23d4
Compare
/test pull-cluster-api-e2e-full-release-0-3 |
/retest |
@fabriziopandini: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
return ctrl.Result{}, errors.Wrapf(err, "failed to delete unhealthy machine %s", machineToBeRemediated.Name) | ||
} | ||
|
||
logger.Info("Remediating unhealthy machine", "UnhealthyMachine", machineToBeRemediated.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hasn't remediation already happened at this point? Or is it in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the machine object is deleted at this point and the KCP job is completed, but the actual machine deletion will take some time to happen, so from a user PoV I think it is correct to say that remediation is in progress (and it shows up in the same way in the conditions as well).
LGTM, squash? :) |
69abfe1
to
b34a457
Compare
/test pull-cluster-api-e2e-full-release-0-3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR adds to KCP support for remediating unhealthy machines according to KCP proposal changes defined by #3676
Which issue(s) this PR fixes:
Fixes #2976