Quadlet: Difference between revisions

From wikinotes
Line 28: Line 28:
{| class="wikitable"
{| class="wikitable"
|-
|-
| <code>~/.config/containers/systemd/*.container</code> || build systemd services from these
| <code>~/.config/containers/systemd/*.{kube,container,volume,network,yml}</code> || build systemd services from these
|-
|-
|  <code>/usr/libexec/podman/quadlet</code> || quadlet executable (not on path)
|  <code>/usr/libexec/podman/quadlet</code> || quadlet executable (not on path)

Revision as of 18:37, 5 May 2024

Quadlet is a tool for generating systemd services from podman containers.
You can also describe a project as a podman-compose project, and generate systemd services for it as well.

The goal for the project is to be concise and change tolerant with sane defaults.

Documentation

official tutorial https://www.redhat.com/sysadmin/multi-container-application-podman-quadlet
src https://github.com/containers/podman/tree/main/pkg/systemd/quadlet

Tutorials

https://mo8it.com/blog/quadlet/ intro

Locations

~/.config/containers/systemd/*.{kube,container,volume,network,yml} build systemd services from these
/usr/libexec/podman/quadlet quadlet executable (not on path)

Usage

While quadlet is technically an executable, it's designed to work with systemd commands directly.

After adding your files to ~/.config/containers/systemd/*.{kube,container,volume,network,yml},
you can run daemon-reload and your generated systemd services will be made available.

Here's the TL;DR from the official tutorial:

mkdir -p $HOME/.config/containers/systemd/
cp envoy-proxy-configmap.yml \
   quadlet-demo.kube \
   quadlet-demo-mysql.container \
   quadlet-demo-mysql.volume \
   quadlet-demo.network \
   quadlet-demo.yml \
   $HOME/.config/containers/systemd/
systemctl --user daemon-reload
systemctl --user start quadlet-demo.service

You can debug the generated files using

/usr/libexec/podman/quadlet --dryrun