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

docs: RFC for disruption.terminationGracePeriod feature #834

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wmgroot
Copy link

@wmgroot wmgroot commented Dec 1, 2023

Design for #743
Implementation PR: #916

Description
RFC for support for disruption.forceDrainAfter (nodeDrainTimeout)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

linux-foundation-easycla bot commented Dec 1, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wmgroot
Once this PR has been reviewed and has the lgtm label, please assign bwagner5 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 1, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @wmgroot!

It looks like this is your first PR to kubernetes-sigs/karpenter 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/karpenter has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @wmgroot. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 1, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 1, 2023
@jackfrancis
Copy link
Contributor

/test ls

@k8s-ci-robot
Copy link
Contributor

@jackfrancis: The specified target(s) for /test were not found.
The following commands are available to trigger optional jobs:

  • /test pull-karpenter-test-1-26
  • /test pull-karpenter-test-1-27
  • /test pull-karpenter-test-1-28
  • /test pull-karpenter-test-1-29

Use /test all to run all jobs.

In response to this:

/test ls

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.

@jackfrancis
Copy link
Contributor

/test pull-karpenter-test-1-26

@jackfrancis
Copy link
Contributor

/test pull-karpenter-test-1-29

@k8s-ci-robot
Copy link
Contributor

@wmgroot: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-karpenter-test-1-26 0ab6f41 link false /test pull-karpenter-test-1-26
pull-karpenter-test-1-29 0ab6f41 link false /test pull-karpenter-test-1-29

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.

@jackfrancis
Copy link
Contributor

@wmgroot thank you for letting me pollute your PR thread w/ some prow tests, just testing out some recent additions, nothing for you to worry about here :)

DESCRIPTION:
NodeDrainTimeout is the total amount of time that the controller will spend
on draining a node. The default value is 0, meaning that the node can be
drained without any time limitations. NOTE: NodeDrainTimeout is different
Copy link
Contributor

Choose a reason for hiding this comment

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

This NOTE suggests that there has been some confusion with this semantic. Any learnings here @jackfrancis?

Copy link
Contributor

@njtran njtran left a comment

Choose a reason for hiding this comment

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

Nice design! Thanks for writing this out. Eager to talk more about this.

designs/disruption-controls-drain-timeout.md Outdated Show resolved Hide resolved
designs/disruption-controls-drain-timeout.md Outdated Show resolved Hide resolved
designs/disruption-controls-drain-timeout.md Outdated Show resolved Hide resolved
designs/disruption-controls-drain-timeout.md Outdated Show resolved Hide resolved
with caution.
```

It might sufficient to skip straight to termination of the node at the cloud provider rather than waiting for a successful force drain to complete.
Copy link
Contributor

Choose a reason for hiding this comment

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

The problem with this is similar to #655. You'll get leaked pods, which is a hefty consideration if we decide to go this way.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure how best to address this problem for daemonset pods which often tolerate all taints. I think we can attempt a force drain for non-daemonset pods as described in the spec, but would need to rely on full termination in the cloud provider for the remaining edge cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Daemonsets tolerating all taints I see as a separate issue. Many daemonsets do this because it's the easiest way to ensure that the pods are running as long as possible, without having to think about all the different addons that may add taints. Whichever ones terminate all taints will either need to be okay with being leaked or we may need to respect their terminationGracePeriodSeconds as well.

@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 Dec 6, 2023
@wmgroot wmgroot changed the title docs: RFC for disruption.forceDrainAfter feature docs: RFC for disruption.terminationGracePeriodSeconds feature Dec 6, 2023
@wmgroot wmgroot force-pushed the force-drain-design branch 2 times, most recently from 7186d87 to ddd9d38 Compare December 6, 2023 09:04
consolidationPolicy: WhenUnderutilized || WhenEmpty
consolidateAfter: 10m || Never # metav1.Duration
expireAfter: 10m || Never # Equivalent to v1alpha5 TTLSecondsUntilExpired
terminationGracePeriodSeconds: 86400 || 24h || nil
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are specifying seconds we shouldn't allow 24h?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, you're correct. I'm going to update it to support standard duration formats for convenience so we don't have to google how many seconds are in a day all the time.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about terminationGracePeriodDuration? Would make it easier to do the thing you're trying to do.

Copy link
Author

Choose a reason for hiding this comment

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

I think I slightly prefer terminationGracePeriod just for brevity, but I don't have very strong opinions.

@wmgroot
Copy link
Author

wmgroot commented Jan 26, 2024

Sounds good to me. We should be able to work on the implementation details in parallel since switching between NodePool vs NodeClaim spec is a fairly trivial part of the actual implementation.

@wmgroot wmgroot force-pushed the force-drain-design branch 2 times, most recently from a2cd377 to d4ad3c2 Compare January 31, 2024 01:11
Copy link

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 14, 2024
@njtran njtran removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 15, 2024
Copy link

github-actions bot commented Mar 1, 2024

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 1, 2024
@njtran njtran removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 4, 2024
@jonathan-innis
Copy link
Member

cc: @akestner

Copy link

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 26, 2024
@njtran njtran removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 27, 2024
Copy link

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 11, 2024
@jonathan-innis
Copy link
Member

/assign @jmdeal

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 17, 2024
Copy link

github-actions bot commented May 1, 2024

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 1, 2024
@jmdeal
Copy link
Member

jmdeal commented May 1, 2024

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 1, 2024
Copy link

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 16, 2024
@jmdeal
Copy link
Member

jmdeal commented May 16, 2024

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants