[Sidecar Containers] Pods comparison by maxContainerRestarts should account for sidecar containers #124936
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/backlog
Higher priority than priority/awaiting-more-evidence.
sig/apps
Categorizes an issue or PR as relevant to SIG Apps.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What happened?
Today, there are a few uses of the function
maxContainerRestarts
- mostly to compare pods to decide which one isbetter to delete or which logs to get. This is not a huge issue, mostly a quality of life improvement.
The code only look at Container Statuses, but likely need to look at init container statuses as well.
Especially in case of sidecar containers that may behave exactly as regular containers.
There are 2 implementations and 5 comparison interfaces.
Implementatons in:
We may need to be careful including all init container statuses. If a Pod was failing to start for a while
because of Init container failures and now it is running OK, it is likely not important. However, including
the restartable containers (sidecars) restart count is important.
I think the desireable behavior will be to check regular containers max restart count first. And compare this.
Then compare max restart count for restarteable init containers.
/kind bug
What did you expect to happen?
Comparison of max container restarts account for init containers as well as regular containers.
How can we reproduce it (as minimally and precisely as possible)?
Two pods - one with the sidecar container in constant restart loop and one is running sucessfully. Random one will be picked to get logs from.
Anything else we need to know?
/sig apps
/priority backlog
KEP: kubernetes/enhancements#753
The text was updated successfully, but these errors were encountered: