-
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
✨ Support range of values for unhealthy machines in machine health check spec #4128
Conversation
Hi @shysank. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@@ -1677,7 +1832,7 @@ func TestIsAllowedRemediation(t *testing.T) { | |||
maxUnhealthy: nil, | |||
expectedMachines: int32(3), | |||
currentHealthy: int32(0), | |||
allowed: true, | |||
allowed: false, |
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.
should MaxUnhealthy
be defaulted in webhooks?
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.
Can you please amend https://github.com/kubernetes-sigs/cluster-api/blob/master/docs/proposals/20191030-machine-health-checking.md to reflect these changes?
/ok-to-test |
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 may also want to revise or update our documentation here (https://cluster-api.sigs.k8s.io/tasks/healthcheck.html#remediation-short-circuiting) to include information about the UnhealthyRange
configuration.
// Any further remediation is only allowed if the number of machines selected by "selector" as not healthy | ||
// is within the range of "UnhealthyRange" |
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.
I'd include a comment here that this property takes precedence over MaxUnhealthy
.
413ce9f
to
f2a8f95
Compare
Thanks for the updates @shysank ! |
// Any further remediation is only allowed if the number of machines selected by "selector" as not healthy | ||
// is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. | ||
// +optional | ||
// +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ | ||
UnhealthyRange *string `json:"unhealthyRange,omitempty"` |
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.
Could we provide an example on how to use the range in the comment?
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.
Looking at the code below, is this range common in Kubernetes API? Do we have an example on how it's being used and implemented in other APIs?
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.
The closest I could find in kubernetes was limit ranges
. for cpu, but I'm not sure if that's what we really want. Another one was service-node-port-range
in api server, but again that was very specific to ports.
/retest |
1 similar comment
/retest |
/lgtm |
/milestone v0.4.0 |
/retest |
/lgtm |
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, lgtm
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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:
Adds new field
UnhealthyRange
to specify unhealthy machine threshold as a range of valuesWhich issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #4020