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
Promote kubelet graceful node shutdown to beta #99735
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -107,10 +107,7 @@ func (m *Manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitR | |||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
// Start starts the node shutdown manager and will start watching the node for shutdown events. | ||||||||||||||||||||||||||||||
func (m *Manager) Start() error { | ||||||||||||||||||||||||||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.GracefulNodeShutdown) { | ||||||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
if m.shutdownGracePeriodRequested == 0 { | ||||||||||||||||||||||||||||||
if !m.isFeatureEnabled() { | ||||||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
@@ -202,9 +199,14 @@ func (m *Manager) aquireInhibitLock() error { | |||||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
// Returns if the feature is enabled | ||||||||||||||||||||||||||||||
func (m *Manager) isFeatureEnabled() bool { | ||||||||||||||||||||||||||||||
return utilfeature.DefaultFeatureGate.Enabled(features.GracefulNodeShutdown) && m.shutdownGracePeriodRequested > 0 | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe have to judge There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should already be covered in the kubelet config validation I think where an error is returned if kubernetes/pkg/kubelet/apis/config/validation/validation.go Lines 143 to 156 in 1021244
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks good, it is best to add a verification of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might not fully understand your comment, we already have a check that if As a result, I'm not clear why it would make sense to add inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. looks great! |
||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
// ShutdownStatus will return an error if the node is currently shutting down. | ||||||||||||||||||||||||||||||
func (m *Manager) ShutdownStatus() error { | ||||||||||||||||||||||||||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.GracefulNodeShutdown) { | ||||||||||||||||||||||||||||||
if !m.isFeatureEnabled() { | ||||||||||||||||||||||||||||||
return nil | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
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're adding a new
+featureGate=GracefulNodeShutdown
tag - if you put it here, later tooling will use it automatically.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.
thanks, I can add that.
Should the
featureGate=GracefulNodeShutdown
tag be added here or in https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubelet/config/v1beta1/types.go (where I see there's already existing tags like+optional
)?