-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Quadlet support depending on health conditions for container #18189
Comments
Wouldn't the systemd way of doing this be just to define a depend relationship between the containers and have the "depended On" container as a notify socket, and wait to notify that the is ready. |
I concur. systemd has a very elaborate dependency management system which, for instance, may block starting a unit until a dependency is up and running. It may also restart a unit if one of its dependencies gets restarted. That being said, I don't think Quadlet should manage these dependencies and let users define the dependencies in the Regarding health checks:
|
In the Quadlet demo, I set the dependency between the WP application Having said that, this means that the naming pattern of the |
A friendly reminder that this issue had no activity for 30 days. |
still important |
@Lunarequest you never responded to @ygalblum comment. |
ah my bad I didn't know i needed to respond. I wanted some way to do a health check specifically as some services eg postgres on init can take a very long time to fully start up which can lead to other services which depend on this service to crash despite it to podman looking like the service has started |
A friendly reminder that this issue had no activity for 30 days. |
@Lunarequest thanks for the added info. I understand the requirement, but I'm not sure that Quadlet is the answer here. At the end of the day, Quadlet is a systemd generator that links between podman commands (run, kube play) and systemd and does not have a life of its own. So, in order to add such dependency management, we need to understand how it can be achieved by using only systemd and podman. Systemd can (and should) be used for dependency management making sure that before starting the dependent service the service on which it depends is running. Now comes the question of what does it mean that the service is running. @rhatdan, @vrothberg WDYT? |
@vrothberg I see that you've just commented on #6160. Isn't this exactly what we are talking about here? |
@vrothberg since #13627 is done, can we start looking at |
Absolutely! I won't find time to work on it short term but feel free to grab it. |
This request looks similar to what I need, so I'm asking here before to open a potential duplicated issue. I have initially created a pod manually and I have attached several containers to it; with |
Does kube yaml have this type of functionality? Init containers? |
As per my understanding, init containers work differently, so that standard containers won't start until init containers are done. For example when I have created my containers manually, I have created a pod X, than I have created a container A with My question is whether it is possible to make |
Just found out that a new feature for init containers have been recently released on kubernetes side (Sidecar containers). |
@ygalblum @umohnani8 PTAL |
I think everything exists in Podman now except for the glue to expose this as a capability inside a I'd like to see it be expanded to a trinary value:
|
Could you open a PR to make that change? |
This expands support for the (previously) boolean `Notify` directive, in support of healthcheck determined SD-NOTIFY event emission, as supported by Podman with the `--sdnotify=healthy` option. Closes: containers#18189 Signed-off-by: Alex Palaistras <[email protected]>
Feature request description
Docker compose has a detective
depends_on
which can be used to depend on containers in a compose stack and wait to start containers that use this until the health check passes, if they don't the service is not started. An example would beAny container in the compose file with this directive will not start until a container named db starts and has a healthy condition, this is useful for things like postgres which take a bit to start up at which point other services that depend on it may fali as postgres hasn't started up.
Suggest potential solution
I would like a directive under
[Container]
that mirrors the depends_on field maybewhere
@healthy
refers to the conditionHave you considered any alternatives?
I have considered add bash to my container and writing a shell script to wait for the db to come up but I would rather not as my container currently is extremely small and has no shell nor coreutils.
Additional context
No response
The text was updated successfully, but these errors were encountered: