-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
should not override KillPodOptions.PodTerminationGracePeriodSecondsOverride by pod spec.TerminationGracePeriodSeconds #109412
Conversation
…erride by pod spec.TerminationGracePeriodSeconds
/retest |
return gracePeriod, status.gracePeriod != 0 && status.gracePeriod != gracePeriod | ||
} | ||
} | ||
// this value is bedrock truth - the apiserver owns telling us this value calculated by apiserver |
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 apiserver owners tell us?
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.
yes
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.
/lgtm
/hold There have been a bunch of issues in flight in this area over the past few releases... wanted to link #98507 #107893 #102025 /cc @smarterclayton |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 249043822, yanghesong 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 |
/cc @rphillips |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
/cc @249043822 Do you have any insight on where this is sitting with the sig-node team? |
@tgoodsell-tempus: GitHub didn't allow me to request PR reviews from the following users: 249043822. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
/priority important-longterm |
@smarterclayton GracePeriod was override by default and executePreStopHook time was not respected. Thus preStopHook execution time is not included in the gracefulTerminationSeconds. It is unexpected. |
/assign @smarterclayton |
// we should keep options.PodTerminationGracePeriodSecondsOverride as it is | ||
// since if options.PodTerminationGracePeriodSecondsOverride is nil, the killContainer interface | ||
// of kuberuntime_container will still calculate a effective grace period for this container termination | ||
return gracePeriod, status.gracePeriod != 0 && status.gracePeriod != gracePeriod |
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.
Do we need to check for gracePeriod < 1
here?
@@ -681,9 +681,6 @@ func (p *podWorkers) UpdatePod(options UpdatePodOptions) { | |||
|
|||
wasGracePeriodShortened = gracePeriodShortened | |||
status.gracePeriod = gracePeriod | |||
// always set the grace period for syncTerminatingPod so we don't have to recalculate, | |||
// will never be zero. | |||
options.KillPodOptions.PodTerminationGracePeriodSecondsOverride = &gracePeriod |
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 we keep this ?
Correct me if I'm wrong: It seems that the gracePeriod
in killContainer
is valued by options.KillPodOptions.PodTerminationGracePeriodSecondsOverride
.
Is that beeter to keep having options.KillPodOptions.PodTerminationGracePeriodSecondsOverride
set by the effective gracePeriod
here?
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Is this issue addressed somewhere / somehow else ? |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Since the gracePeriodOverride in KillContainer is only used for killing container, not contains the preStop time, so we should not always set this param in podworker, because we may also lose the probe.TerminationGracePeriodSeconds.
kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go
Line 716 in 7380fc7
terminationGracePeriodSeconds is 30, and the hook takes 10 seconds to complete, and the Container should take 20 seconds to stop, but the log shows 30
pod is evicted, it should be killed with PodTerminationGracePeriodSecondsOverride 0, but the log shows 10
Which issue(s) this PR fixes:
Fixes ##109352
Special notes for your reviewer:
/cc @smarterclayton @rphillips
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: