Skip to content
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 for initContainers #24680

Open
hluengas opened this issue Nov 25, 2024 · 0 comments
Open

Quadlet support for initContainers #24680

hluengas opened this issue Nov 25, 2024 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. quadlet

Comments

@hluengas
Copy link

hluengas commented Nov 25, 2024

Feature request description

It seems pod initContainers are only supported manually through podman-create (using --init-ctr) or with systemd through [kube] quadlet definitions (using an initContainers definition in the supplied yaml).

It would be nice if quadlet [pod]/[container] definitions also supported this important feature.

As a user, I want to use one type of resource defintion for all my container infrastructure. To that end, native quadlet should support all the features for pods that [kube] definitions support, including initContainers.


Suggest potential solution

I don't have much knowledge of how podman works under the hood, but as a user I would suggest that a quadlet definition for a [container] unit should have another key similar to StartWithPod like

InitContainer=true

The description for StartWithPod mentions:

If Pod= is defined, container is started by pod

The new key, InitContainer would also have a dependency on Pod= and also be a simple boolean value.

I am not sure if podman-run would also need to be changed to add initContainer support or if quadlet changes alone are sufficient.

As I understand, [pod] & [container] quadlet units utilize podman-run, while [kube] units utilize podman-kube-play.

podman-kube-play supports initContainers, but podman-run does not. In native podman this is only supported using podman-create.


Have you considered any alternatives?

I am aware what I want to do can be achieved with [kube] quadlet units but i think this feature should be available with [container] & [pod] units also.


Additional context

For some context I previously defined all my container infrastructure using [kube] systemd/quadlet definitions as it seemed like the most clean and portable way, but eventually I encountered some podman functionality that wasn't well supported using this method.

For example I struggled to get GPU access working in a rootless container using a [kube] definition but was able to use the combination of --device and --group-add keep-groups with a the [pod] and [container] defintions.

Because of this I bit the bullet and swithced to using the pure quadlet definitons, because it seemed that kube-play support is more of a compatability after thought.

Now I find myself needing to setup a pod with a certbot initContainer, and of course I want to use systemd to manage the lifecycle of the pod, but it seems this is only possible using a [kube] quadlet definition.

The only other issue I found for this Vrothberg mentions:

"I agree. podman generate systemd shouldn't receive new features as our focus lies on Quadlet which supports running Pods by means of Kubernetes YAML."

@hluengas hluengas added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 25, 2024
@Luap99 Luap99 added the quadlet label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. quadlet
Projects
None yet
Development

No branches or pull requests

2 participants