Nomad support for mounted volumes with Podman

I am doing some proof of concept work using Nomad to orchestrate several different containers running on RHEL 8 hosts using Podman. I am using the Nomad Podman driver to execute my containers using Podman. I have shared state in the form of an Elasticsearch data directory that I mount into /usr/share/elasticsearch/data .

I initially tried to get this working by defining a host volume in the Nomad client configuration, then adding a volume stanza that references my host volume and a volume mount stanza that references the volume in my Nomad job specification. That approach didn’t work - no errors, but the mounting never happens.

After some digging, I found that the Podman task driver’s capabilities documentation says that volume mounts are not supported. Instead, I seem to have to use the more limited driver-specific volumes configuration.

So my question is this: Is the lack of support for volume mounts just a temporary shortcoming that will eventually be supported? It does appear that the Docker task driver supports volume mapping and only Podman does not, so perhaps the Podman driver is just not there yet? Or is there a specific reason why there is a difference between how Docker supports volumes and how Podman does it?

2 Likes

Would love to see full support for podman, including volumes.

1 Like

You can use the drivers volumes stanza to bind mount any host folder into the container. It’s ok but not strictly necessary to declare a nomad host volume as well. Doing so has the benefit that you can depend your tasks on certain hosts .

Beware that Nomad volume_mount stanzas are not supported yet. So you can not use a named volume in the task specification. Always use the absolute host-level path instead.

I’m really glad I found this post. But I only I found it after a lot time spent banging my head against the wall. I would love to see this documented better.

I followed this tutorial: Stateful Workloads with Nomad Host Volumes | Nomad - HashiCorp Learn and it doesn’t say anything about the volume_mount stanza only working with the Docker driver. And As @TimothyMDean says, there are no errors when trying to mount a volume using the Podman driver.

@jeffreycwitt thank you for feedback.

I created a issue over at the drivers github repository. It’s not hard to add support for this stanza but i can not give you any ETA for this feature.

1 Like