-
Notifications
You must be signed in to change notification settings - Fork 2.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
pod can not be removed because of extra containers #11713
Comments
You need to stop the infra container. Either use |
@Luap99 the question is why there are extra containers in the first place and why people need to care about these internal details? |
@abitrolly our pod implementation currently uses an infra container (as was standard in the kube world). The infra container basically owns the network and other namespaces. in the future, this is something we would like to eliminate but currently is not a priority. |
@baude does "was" means that kubernetes doesn't use any extra container anymore? And doesn't expose them to users, right? If the pod is empty, why the |
Allowing removal of pods where 1 container is running (and it's the infra container) seems reasonable |
I agree, we should automatically stop the infra container with a -t 0 field. |
@abitrolly you asked why it was this way in podman, i answered. it seems like are in agreement to fix the behavior. |
@baude yep. It would also be nice to keep this ticket open until it is fixed. |
Is this only in conjunction with podman-compose? Or is this affected by the image infra is using? running a |
It's directly invoking the CLI, so that's just a |
hmmm interesting because |
Yeah, that sounds right - I imagine we must have been handling this already. I think at this point we need to try and reproduce with |
update here so I can keep track of my though process: my only idea is that since the |
Pods were sometimes failing to remove if infra was running. Added a pod stop command and --force flag to pod rm within compose_down resolves containers/podman#11713 Signed-off-by: cdoern <[email protected]>
@cdoern that doesn't fix the root cause, so I don't think containers/podman-compose#340 resolves this behavior, |
What do you mean by root issue @abitrolly I am pretty sure a --force will get rid of infra if the pod stop didn't stop it. |
The root issue is that |
This is the place where the failure happens. podman/libpod/runtime_pod_linux.go Lines 211 to 214 in 1de96f2
|
But the code that explicitly checks for this condition is above here. podman/libpod/runtime_pod_linux.go Lines 183 to 188 in 1de96f2
Maybe there are some race conditions. Need a verbose mode to show. |
I used more lightweight project to track the issue. So the error happens when
I occasionally use |
OK, that makes more sense. I think that can be said to be working as designed; the pod is not empty, so we're refusing to remove without |
If the pod is not empty, then the error should list all containers that are not empty, but it lists only internal container. |
Sure - looks like the error messages are out of order. |
Speaking of errors it would be more user friendly to report container names along with their hashes to understand what is going on. |
The one shot containers are not removed first using container rm? Seems like that is the expected outcome, right? I say we should either print a better err msg and leave it as is, or make sure that infra actually gets removed via --force |
Yes let's improve the error message, and ensure that the remove --force. |
so my compose PR, fixes the |
Made changes so that if the pod contains all exited containers and only infra is running, remove the pod. resolves containers#11713 Signed-off-by: cdoern <[email protected]>
Made changes so that if the pod contains all exited containers and only infra is running, remove the pod. resolves containers#11713 Signed-off-by: cdoern <[email protected]>
/kind bug
Description
podman pod
creates an extra container fromk8s.gcr.io/pause:3.5
that applications are not aware of and can not clean up properly. This happens withpodman 3.3.1
andpodman-compose
.Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
No errors when running
podman pod rm
.Output of
podman version
:Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
The text was updated successfully, but these errors were encountered: