-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
"Completed" Container should not be in back-off that resulting in "CrashLoopBackOff" #53125
Comments
I'm going to close this as WAI. The desired behavior in this case is to set the Pod RestartPolicy to "OnFailure". See https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy |
@tallclair does that mean there is no way to have a container exit (with a success state / exit code 0) and be restarted without ending up in the crash loop back-off? At my current employer we have a range of queue consumers that due to language implementation limitations and other assorted reasons, we gracefully exit after a minute of idle time and restart. While trying to migrate these processes to kubernetes, we've run into the problem that they end up in said loop. It seems to me that that the crash loop back-off should only apply to containers that actually crashed? If a container exits gracefully, I am not sure why that is considered a crash? |
This is exactly my use case and it seems like a scheduler level issue, not application level. Having to wrap what seems like correct behaviour in a supervising process adds another level of complication (signal handling etc.) |
The system has to do work to restart the container. If the container is continuously exiting (even if it's success), then that creates a lot of churn for the system without a backoff. |
Hi there, we have exactly the same situation: our consumers/workers pulling messages from a FIFO needs to restart regularly due to technical limitations. We thought K8S would handle this for us but we just discovered this is not the case due to the CrashLoopBackOff. We end up having to use a process manager like supervisord inside our container as a workaround. Is there a change this behavior will change in the future? |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
/sig scheduling
What happened:
Deploy a simple pod that let it exit normally.
After it finished successfully, the pod run into a back-off loop that kept restarting again to "CrashLoopBackOff".
What you expected to happen:
To be in "Completed" status
How to reproduce it (as minimally and precisely as possible):
As above
Anything else we need to know?:
Environment:
kubectl version
):master branch
uname -a
):The text was updated successfully, but these errors were encountered: