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

feat: add node graceful shutdown kubelet config #4149

Closed
wants to merge 5 commits into from

Conversation

weichch
Copy link

@weichch weichch commented Mar 11, 2024

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

This PR adds node graceful shutdown Kubelet config items and exposes those for client use, so that we can allow customers to enable this feature on their nodes.

This PR is recreated from the previous PR (#4147) from fork as per comment.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

weichch added 3 commits March 12, 2024 11:13
Co-authored-by: Wei Chen<[email protected]>
Co-authored-by: Wei Chen<[email protected]>
@weichch weichch force-pushed the weichen/graceful-node-shutdown branch from 5023413 to 2864425 Compare March 11, 2024 22:13
@coveralls
Copy link

coveralls commented Mar 11, 2024

Pull Request Test Coverage Report for Build 8318498735

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 79.385%

Totals Coverage Status
Change from base Build 8304229022: 0.04%
Covered Lines: 2299
Relevant Lines: 2896

💛 - Coveralls

@weichch
Copy link
Author

weichch commented Mar 11, 2024

As per mentioned in #4147, the feature gate is by default enabled in all k8s versions we currently support.

Copy link
Collaborator

@cameronmeissner cameronmeissner left a comment

Choose a reason for hiding this comment

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

approved pending agentbaker e2es

@weichch weichch enabled auto-merge (squash) March 12, 2024 06:05
@weichch weichch disabled auto-merge March 12, 2024 06:06
// Default: "0s"
// +featureGate=GracefulNodeShutdown
// +optional
ShutdownGracePeriodCriticalPods Duration `json:"shutdownGracePeriodCriticalPods,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do we validate whether ShutdownGracePeriodCriticalPods is lower than ShutdownGracePeriod?

Copy link
Author

Choose a reason for hiding this comment

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

Validation is going to be in RP, similar to ImageGcHighThreshold and ImageGcLowThreshold.

@@ -497,6 +497,12 @@ func setCustomKubeletConfig(customKc *datamodel.CustomKubeletConfig,
if customKc.PodMaxPids != nil {
kubeletConfig.PodPidsLimit = to.Int64Ptr(int64(*customKc.PodMaxPids))
}
if customKc.ShutdownGracePeriod != nil {
Copy link
Author

Choose a reason for hiding this comment

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

I also wanted to add some defaulting logic based on Kubernetes version. What do you think if we add IsKubernetesVersionGe(xxx) in this method? @UtheMan

@weichch
Copy link
Author

weichch commented Mar 18, 2024

I'm putting this on hold now as there might be some investigations I need to do before this can be merged.

@weichch weichch marked this pull request as draft March 18, 2024 22:07
@cameronmeissner
Copy link
Collaborator

@weichch closing for now due to inactivity, feel free to reopen when needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants