Hi Valentin,

Thanks for sharing that ticket, I'll keep an eye on it. It's nice to know that I wasn't missing something obvious already in the docs!

Thanks,
brian


On Thu, Jan 30, 2020 at 2:39 AM Valentin Rothberg <rothberg@redhat.com> wrote:
Hi Brian,

thanks for reaching out!

On Thu, Jan 30, 2020 at 12:04 AM Brian Fallik <bfallik@gmail.com> wrote:
Hi,

Does anyone have an example they can share of managing a pod in systemd?

podman-systemd-generate supports pods. It will generate one service for the pod (pause container) and one for each container of the pod and set the dependencies accordingly.
 
I'm trying to follow the guidelines outlined in
which work great for containers but now I'm unsure how to proceed for a pod.

Ultimately I'm trying to deploy prometheus alongside nginx as a reverse proxy, and deploying both containers inside a pod seems easiest from a networking perspective and also sensible logic since the two containers are coupled into a single, functional unit.

As you noted, the upper blog post focuses on the container-case only. With the next version of Podman, podman-generate-systemd ships with a --new flag to generate such portable/shareable service files.

However, it does not yet support pods but we are working on it, which is tracked in the upstream issue [1].
 
For the case of the pod, what PID does systemd track? Is it the pause container? If so, how does that happen? `podman pod create` doesn't seem to accept --conmon-pidfile args like `podman run` does.

I also tried using the output of `podman generate systemd` but that seems tied to a specific pod instance. Ideally I'd find something more generic like the pattern I extracted from the blog post above.

I suggest following the upstream issue [1] for updates. Supporting --new for pods is definitely on our todo-list.

Thanks for reaching out.

Kind regards,
 Valentin

[1] https://github.com/containers/libpod/issues/4875