-
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
Handle initContainer for Pods #6480
Comments
Creating the init containers seems fairly easy, and I think we can order pod startup to ensure that they are the first things to run in the pod without a problem (we already have a built-in startup dependency model), but the behaviour where Kube waits until an init container has cleanly exited to start the next one is problematic - all our dependency ordering is based on the dependency moving to the "running" state, and from a glance at the code this won't be easy to fix. We'd probably need to add the concept of init containers to Libpod pods, and modify the @haircommander Thoughts? |
Theoretically, we could spoof init containers on podman side, and not expose to libpod.
|
though, if you think it'd be useful outside of play kube, exposing to libpod would keep play kube code cleaner |
If there's an expectation that init containers run more than once - IE, on each start of the pod - I think libpod is a good place. Kube doesn't really hit this, given they never restart a stopped pod, just recreate, but we will. |
We'll also have to modify pod status - a pod where everything except the init containers is running is still a running pod, where I think we'd consider it partially stopped. |
yeah we'd need to restart the init container process if we restarted the pod
I think a pod state: initializing would be clear for when the init containers are running. I think the containers could be ignored (or they could be cleaned up) in figuring out if the pod is running with little problem |
A friendly reminder that this issue had no activity for 30 days. |
@haircommander Are you working on this? |
I am not currently working on this! |
@ryanchpowell Want to take a look? |
@rhatdan sounds good, looking into! |
This issue is still out there. @mheon @haircommander @durandx is this still something we should pursue? |
How to record the startup sequence of initContainers |
A friendly reminder that this issue had no activity for 30 days. |
@rhatdan From my part, I think it is still a good idea to have initContainers. One of the use case could be to have a generic container (ex: tomcat) that can be associated with a specific container started with initContainer whose role is to copy, configure and deploy one or more app(s) (ex: my-app.war). |
Interested in working on it? |
Hello there, |
A friendly reminder that this issue had no activity for 30 days. |
Coming up on a year later and no one has worked on this. |
How to record the startup sequence of initContainers |
Just wonder if any progress here? As @cjeanner mentioned above, it can be a killer feature for TripleO/OSP in Openstack, would help a lot. |
@mheon would the work you have done on "requires" help with this? IE Could we put requires into a POD, so that we have one of the containers start before the others in the pod? |
Sure, you can likely wire this up manually in the CLI now. |
You'd basically create the initContainer first, then have every other container in the pod do a |
Unfortunately, |
I think initContainers should run and finish before any containers start in the pod, at least according to their definition. To @zhangguanzhang question - need to take list of |
for |
Can we start maybe from |
I could see podman play kube, looking for init containers, and running them within a pod, and then waiting for them to complete before executing the rest of the containers. Perhaps we could extend the concept for a POD as well, so that an indicator of an initcontiner means that all of the other containers in the POD would not start until the initcontainer is done. |
ISTM that
However there are issues:
So it would be better if the init container(s) in the pod could be marked for special treatment. Obviously this would also become important if podman were to provide automatic container restarts. |
There was a point raised earlier about whether restarting a pod should re-run its init containers or not. I can see use cases for both scenarios:
On balance, I think the most useful behaviour is always to run the initContainers on pod (re)start. If someone wants an initContainer which doesn't reinitialize a data volume, they can easily check first whether the data is there or not. This doesn't matter too much given that k8s doesn't support restarting pods anyway, but it might be useful for those running pods under systemd. |
A friendly reminder that this issue had no activity for 30 days. |
Still no one has worked on this? |
I'll take it .... |
Fixes by: #11011 |
@zhangguanzhang: 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. |
/kind feature
A nice feature to have in podman could be handle initContainer in the same way that K8S handle it.
The main problem is that container images and architecture has to be modified between pods in K8s and Podman : K8s can use a dedicated initContainer to properly initialise a pod whereas in podman we have to combine initialisation and core runtime in a single container. This limit the reuse and compatiblity between K8S and podman even for very simple pods.
The text was updated successfully, but these errors were encountered: