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

Kubelet may reject static pods when the node is out of disk space, and will not retry them #35521

Closed
justinsb opened this issue Oct 25, 2016 · 22 comments
Labels
area/kubelet area/reliability kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/node Categorizes an issue or PR as relevant to SIG Node. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@justinsb
Copy link
Member

If a pod fails admission (admission controller, disk space, or network not ready as of #33347), it is not retried.

I think this is the cause of #35409

Working up a PR now... I am thinking of keeping a list of pods that were rejected, and reattempting them every housekeeping interval.

@yujuhong
Copy link
Contributor

@justinsb pod phases progress monotonically. Once a pod has been rejected and transition to the "Failed" state, it is not supposed to go back to pending or running. I don't think kubelet should retry them

@justinsb
Copy link
Member Author

But - for example - we check disk space in canAdmitPod. That is a temporary condition.

How do you propose to handle this instead?

@yujuhong
Copy link
Contributor

kubelet doesn't care about whether the condition is temporary or not (for regular pods). It assumes the control plane (e.g., ReplicaSet) can react and determine what to do.

@yujuhong
Copy link
Contributor

/cc @kubernetes/sig-node

@justinsb
Copy link
Member Author

justinsb commented Oct 25, 2016

Hmmm.. that is tricky because of static pod manifests. I put the network-readiness check in the same place as the disk space check, as I figured that was the closest analog.

Looking for a place to move it such that the pod can be admitted, but where we can prevent it actually starting:

  1. Any suggestion?
  2. Should I move the disk free-space check there also?

@justinsb
Copy link
Member Author

How about in Kubelet::syncPod?

@yujuhong
Copy link
Contributor

Hmmm.. that is tricky because of static pod manifests. I put the network-readiness check in the same place as the disk space check, as I figured that was the closest analog.

@justinsb hmm....even for regular pods, this behavior seems undesirable. If kubelet restarts, and the network plugin is not ready (due to podCIDIR) yet, it would reject all pods assigned to it. That seems to be what caused the serial suite to fail.

How about in Kubelet::syncPod?

It might work. That just means kubelet will not sync the pod if network is not ready. I don't think disk space should be moved to the same space because kubelet actually wants to reject them.
/cc @dchen1107

Can we revert your original PR first? Thanks.

@justinsb
Copy link
Member Author

Can we revert your original PR first? Thanks.

I feel like I've seen bad behaviour with full disks, so it feels like this is actually exposing a pre-existing problem. I don't understand why we would permanently reject a static pod if the disk was full?

It feels like we should move both to syncPod... I have a WIP PR which I'm testing now - can we give me a few minutes to see if that just fixes things, and then if not we can revert?

@justinsb
Copy link
Member Author

Actually, on second thoughts, if we're blocking the submit queue we can just revert. It sounds like this is a non-trivial issue, so it's worth finding the right solution.

@yujuhong
Copy link
Contributor

Actually, on second thoughts, if we're blocking the submit queue we can just revert. It sounds like this is a non-trivial issue, so it's worth finding the right solution.

I don't think it's blocking the submit queue. Since you no longer need to change the admission logic, there are parts in your original PR that's not needed anymore. I think reverting makes sense here, and will make cherrypicking easier too.

@yujuhong yujuhong changed the title kubelet does not retry pods that fail admission Kubelet may reject static pods when the node is out of disk space, and will not retry them Oct 25, 2016
@yujuhong
Copy link
Contributor

I feel like I've seen bad behaviour with full disks, so it feels like this is actually exposing a pre-existing problem. I don't understand why we would permanently reject a static pod if the disk was full?

This is a bug, and it should be fixed. I changed the title to reflect that (thanks). The immediate solution if anyone encounters such a situation is to restart kubelet to let the pods go through the admission process again.

@justinsb I don't think your new PR needs to change the admission logic at all, so it shouldn't be affected by this bug.

@yujuhong yujuhong added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed team/control-plane labels Oct 25, 2016
@timstclair
Copy link

Related PR: #35342

Conditions which the scheduler is not aware of, or that should be retried on the same node should be "soft rejected", i.e. the pod should not be marked as failed, instead it should be blocked from starting.

@dchen1107
Copy link
Member

Related to: #22212

k8s-github-robot pushed a commit that referenced this issue Nov 6, 2016
Automatic merge from submit-queue

kubelet bootstrap: start hostNetwork pods before we have PodCIDR

Network readiness was checked in the pod admission phase, but pods that
fail admission are not retried.  Move the check to the pod start phase.

Issue #35409 
Issue #35521
@yujuhong yujuhong added this to the next-candidate milestone Nov 8, 2016
@fejta-bot
Copy link

Issues go stale after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 19, 2017
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 18, 2018
@yujuhong yujuhong added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jan 18, 2018
@wgahnagl
Copy link
Contributor

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 24, 2021
@gjkim42
Copy link
Member

gjkim42 commented Jun 25, 2021

/assign

@gjkim42
Copy link
Member

gjkim42 commented Jun 25, 2021

/unassign

I don't want to make another exception for static pods...

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Jun 25, 2021
@ehashman ehashman added this to Triage in SIG Node Bugs Jul 9, 2021
@ehashman
Copy link
Member

ehashman commented Aug 5, 2021

/milestone clear

@k8s-ci-robot k8s-ci-robot removed this from the next-candidate milestone Aug 5, 2021
@ehashman ehashman moved this from Triage to Triaged in SIG Node Bugs Aug 11, 2021
@ehashman ehashman moved this from Triaged to Triage in SIG Node Bugs Aug 11, 2021
@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Needs Information in SIG Node Bugs Sep 1, 2021
@SergeyKanzhelev
Copy link
Member

/triage needs-information

need repro on the latest versions of confirmation from somebody experiencing it

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 1, 2021
@matthyx
Copy link
Contributor

matthyx commented Aug 29, 2022

Please reopen if you experience this issue.
/close

@k8s-ci-robot
Copy link
Contributor

@matthyx: Closing this issue.

In response to this:

Please reopen if you experience this issue.
/close

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.

SIG Node Bugs automation moved this from Needs Information to Done Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet area/reliability kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/node Categorizes an issue or PR as relevant to SIG Node. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
Development

No branches or pull requests