-
Notifications
You must be signed in to change notification settings - Fork 4.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
DrainAndValidate rolling-update hangs if pods won't evict #2537
Comments
what did cli switches you use? |
none, just the usual |
So it should have timed out, which is interesting. Did you use the feature flag to turn on drain? |
yes, in another instance where it hung I deleted a pod manually that was stuck in |
@foxish any way to have a pod not evict? How do I reproduce this? |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Sorry, I never saw this @chrislovecnm. |
/lifecycle frozen |
I am having the exactly same behavior on AWS. (edited, similar issue I'd say) I have ~10 nodes and on some of them the node cannot be drained and gets stuck on SchedulingDisabled state. All the pods inside this node is being evicted however it doesn't complete. When I terminate the instance manually it continues and goes on. I notice that the only pods left on those nodes are managed by DaemonSets. Maybe that is somehow related. Any way to investigate this further? |
I had a similar issue just now, a normal pod (nginx ingress controller) was still in running state and had been deployed for over 5 days. Somehow it kept the rolling update stuck (no timeout etc). It has however been restarted 676. Unfortunately I did not look at the logs or anything before I manually terminated the pod, so I can not even verify that there restarts are related to the rolling update but it has now been fixed and the rolling update could move on. If it happens again I will make sure to check logs etc for anything suspicious. Edit: Yeah strange just happening again, the nginx controllers could not be evicted. I could not see anything in the logs (some of them where not even serving any traffic), nothing on Even if the issue is not necessarily fixable, I wonder if it is possible to show more logs? To not have to guess that something is up. |
So strange, this keeps on happening now and is a subset of pods related to the nginx ingress controller (it is the internal ingress controller and the default backend for both internal and public ingress controller). The interesting thing is they are all deployments with 1 pod (where-as the public ingress controller has 2) but the rolling update strategy is set to:
so do not think this is related but thought it was worth posting. |
I've noticed similar behaviour, I'm using I had to manually kill all |
Same issue here, this is the second time |
I had the same here, also with nginx-ingress, but the issue was revealed by addding verbosity to the rolling update: I then saw:
So really kops was doing the right thing, just not being very chatty about it. I just had to have more than 1 replica and then decrease |
Would be very helpful if kops could log when it is waiting for pods with disruption budgets. |
I agree with making this important, spent some time wondering why my node replacement was stuck. Someone in slack said it was likely to be waiting for pods with disruption budgets and that was the case. |
@mf-lit how did u change the |
@inodb That helm chart has what you need: Either set the replica count with this value: And then make sure your PDB is set to a value appropriately lower than the Replica count: |
Having thought about this a little more, one of the gotchas of that chart (and many helm charts) is that the ReplicaCount defaults to 1 and the PDB MinAvailable also defaults to 1. This is perfectly reasonable, but means that it impossible to evict the pod. I think (but haven't tested) it would be better to have minAvailable set to 0 when ReplicaCount is 1, which I think is equivalent to not having a PDB at all, which makes more sense with a single replica. EDIT: Ah, I see someone has already brought this up: |
I'm having a similar issue, running a rolling update always hangs on "instancegroups.go:332] Waiting for 1m30s for pods to stabilize after draining." Edit: I haven't actually seen it in the documentation, but do I have to disable pod availability scaling first? |
In our clusters we are running some jobs we don't want interrupted. Some of these jobs can take a full day. Because we didn't want the jobs interrupted, we resorted to setting up a Pod Disruption Budget, setting max unavailable to 0. This works quite nicely, and keeps the jobs around until they complete. The problem I have arises when I perform a rolling update on the cluster. Whenever kops gets to a node running one of these uninterruptible pods, it just hangs until the pod completes. Sometimes the blocked node can be the first node in a rolling update. In the mean time, more uninterruptible pods can easily have been scheduled to additional nodes that needs to be rolled. It would be much nicer if kops would wait for a while (maybe 5 minutes), and if the drain operation had not completed, kops would skip the node, and continue with a different node. Then finally when all other nodes had been rolled, kops could get back to the blocked nodes and wait for the pod to complete. |
hi, i found this ticket by searching on github.
|
/area rolling-update |
It would be useful to have a flag that ignores PDB after a certain amount of time. This will trip anyone if they have a PDB of 1 with a replica of 1 it will just sit for a long time waiting for something that will never come. |
@sstarcher I believe that would be a separate feature request. I happen to think such a thing would be quite dangerous, but it would be useful when the cluster operators and the workload developers have an adversarial relationship. I believe this particular ticket should be closed as "that's the intended behavior". |
@johngmyers originally this ticket had nothing to do with PDBs. Containers can get stuck in But it might be good to document and/or add output that explains why the timeout occurred, Kops does validation elsewhere and explains why it fails, this would be just another flavor. |
It might be good to change the title of this issue to limit its scope to I believe kops's logging of hung drains is better now. |
@blakebarnett Would you have a procedure for getting a pod hung in ContainerCreating? I tend to agree a stuck ContainerCreating pod blocking eviction seems a problem with the Kubernetes eviction implementation. |
We've seen it usually when there has been resource contention on a node, and something puts the node into an unrecoverable state. It happens for quite a few different reasons, but I believe it's usually because of the contention and the bad behavior of most apps in that scenario. It's been hard to reproduce it intentionally though. When oom-killer kicks in at the system level and happens to pick dockerd as the process to snipe that definitely seems to be problematic. We've seen it with the |
Could you file a Kubernetes issue? I believe pods in ContainerCreating state should not block voluntary eviction, be they stuck or not. It's not as if they have state that needs grace to terminate. Or is it the "wait for pods to terminate" phase they're blocking, not voluntary eviction? |
kops now has /close |
@olemarkus: Closing this issue. 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. |
I noticed a few instances where if a pod is hung in
ContainerCreating
state, or some other state and won't go intoEvicted
state Kops hangs forever waiting for it during a rolling-update.The text was updated successfully, but these errors were encountered: