Skip to content
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

✨ Add remediation strategy support in MachineDeployment #10712

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented May 31, 2024

What this PR does / why we need it:

We're currently always remediating as much as the MachineHealthCheck marks as unhealthy without any waiting. This PR is a first step to fix that issue by adding a Remediation strategy on MachineDeployment which allows to set maxInFlight remediations allowed.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area machineset

@k8s-ci-robot k8s-ci-robot added the area/machineset Issues or PRs related to machinesets label May 31, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 31, 2024
@vincepri
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 31, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 31, 2024
@vincepri vincepri force-pushed the machineset-maxflight branch 6 times, most recently from 52640c5 to 88905d4 Compare June 3, 2024 22:50
@enxebre
Copy link
Member

enxebre commented Jun 4, 2024

it'd be good to have test case that ensures max inflight is honoured, lgtm otherwise

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 5, 2024
@vincepri vincepri force-pushed the machineset-maxflight branch 2 times, most recently from a5e4aab to efc2894 Compare June 5, 2024 15:37
@vincepri
Copy link
Member Author

vincepri commented Jun 5, 2024

/hold cancel

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 93e93d79444e789873f6a8ec02bd4ed8ca52c7ea

api/v1beta1/machinedeployment_types.go Outdated Show resolved Hide resolved
api/v1beta1/machinedeployment_types.go Show resolved Hide resolved
api/v1beta1/machinedeployment_types.go Outdated Show resolved Hide resolved
api/v1beta1/machinedeployment_types.go Outdated Show resolved Hide resolved
api/v1beta1/machinedeployment_types.go Outdated Show resolved Hide resolved
internal/controllers/machineset/machineset_controller.go Outdated Show resolved Hide resolved
internal/controllers/machineset/machineset_controller.go Outdated Show resolved Hide resolved
internal/controllers/machineset/machineset_controller.go Outdated Show resolved Hide resolved
internal/controllers/machineset/machineset_controller.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2024
@vincepri vincepri force-pushed the machineset-maxflight branch 2 times, most recently from 68e759a to dc4d302 Compare June 11, 2024 18:04
@vincepri
Copy link
Member Author

/assign @sbueringer

for final review

@sbueringer
Copy link
Member

sbueringer commented Jun 12, 2024

Getting close, I think

Signed-off-by: Vince Prignano <vince@prigna.com>

tests

Signed-off-by: Vince Prignano <vince@prigna.com>
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

Thank you very much!

/lgtm

@fabriziopandini fyi, the new field is also supported in CC (see: #10712 (comment))

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 12, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a8c9362ae8df69e2124741eef69e4e04a01fca54

@sbueringer
Copy link
Member

/assign @fabriziopandini @chrischdi @enxebre
for a final pass

@vincepri vincepri changed the title ✨ Add remediation strategy support for MachineSet ✨ Add remediation strategy support in MachineDeployment Jun 12, 2024
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2024
@k8s-ci-robot k8s-ci-robot merged commit 77a4db2 into kubernetes-sigs:main Jun 13, 2024
26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone Jun 13, 2024
@vincepri
Copy link
Member Author

/cherry-pick release-1.7

@k8s-infra-cherrypick-robot

@vincepri: #10712 failed to apply on top of branch "release-1.7":

Applying: sparkles: Add remediation strategy support for MachineSet
Using index info to reconstruct a base tree...
M	api/v1beta1/zz_generated.openapi.go
M	config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml
M	config/crd/bases/cluster.x-k8s.io_clusters.yaml
M	config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml
M	internal/apis/core/v1alpha3/zz_generated.conversion.go
M	internal/apis/core/v1alpha4/zz_generated.conversion.go
M	internal/controllers/machineset/machineset_controller.go
M	internal/controllers/machineset/machineset_controller_test.go
M	internal/webhooks/machinedeployment.go
M	test/e2e/clusterclass_rollout.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/clusterclass_rollout.go
Auto-merging internal/webhooks/machinedeployment.go
Auto-merging internal/controllers/machineset/machineset_controller_test.go
Auto-merging internal/controllers/machineset/machineset_controller.go
CONFLICT (content): Merge conflict in internal/controllers/machineset/machineset_controller.go
Auto-merging internal/apis/core/v1alpha4/zz_generated.conversion.go
Auto-merging internal/apis/core/v1alpha3/zz_generated.conversion.go
Auto-merging config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml
Auto-merging config/crd/bases/cluster.x-k8s.io_clusters.yaml
Auto-merging config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml
Auto-merging api/v1beta1/zz_generated.openapi.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 sparkles: Add remediation strategy support for MachineSet
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.7

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/machineset Issues or PRs related to machinesets cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants