Quadlet: Difference between revisions

From wikinotes
 
(15 intermediate revisions by the same user not shown)
Line 8: Line 8:
{| class="wikitable"
{| class="wikitable"
|-
|-
| official tutorial || https://www.redhat.com/sysadmin/multi-container-application-podman-quadlet
| <code>man quadlet / podman-systemd.unit</code> (incl. filetypes/opts) || https://man.archlinux.org/man/quadlet.5.en
|-
| official multi-container tutorial || https://www.redhat.com/sysadmin/multi-container-application-podman-quadlet
|-
|-
| src || https://github.com/containers/podman/tree/main/pkg/systemd/quadlet
| src || https://github.com/containers/podman/tree/main/pkg/systemd/quadlet
Line 28: Line 30:
{| class="wikitable"
{| class="wikitable"
|-
|-
| <code>~/.config/containers/systemd/*.container</code> || build systemd services from these
| <code>~/.config/containers/systemd/*</code> || generators for user systemd services (only for rootless podman)
|-
| <code>/etc/containers/systemd/*</code> || generators for system systemd services
|-
| <code>/usr/share/containers/systemd/*</code> || generators for system systemd services (installed by packages)
|-
|-
|  <code>/usr/lib/podman/quadlet</code> || quadlet executable (not on path)
|}
|}
</blockquote><!-- Locations -->
</blockquote><!-- Locations -->


= Usage =
= Notes =
<blockquote>
<blockquote>
While quadlet is technically an executable, it's designed to work with systemd commands directly.
{| class="wikitable"
|-
| [[quadlet install]]
|-
| [[quadlet usage]]
|-
| [[quadlet syntax]]
|-
|}
</blockquote><!-- Notes -->


After adding your files to <code>~/.config/containers/systemd/*.{kube,container,volume,network,yml}</code>,<br>
= Examples =
you can run daemon-reload and your generated systemd services will be made available.
<blockquote>
 
{| class="wikitable"
Here's the TL;DR from the official tutorial:
|-
<syntaxhighlight lang="bash">
| [[quadlet example: single container with volume]]
mkdir -p $HOME/.config/containers/systemd/
|-
cp envoy-proxy-configmap.yml \
|}
  quadlet-demo.kube \
</blockquote><!-- Examples -->
  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
</syntaxhighlight>
</blockquote><!-- Usage -->

Latest revision as of 21:43, 18 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

man quadlet / podman-systemd.unit (incl. filetypes/opts) https://man.archlinux.org/man/quadlet.5.en
official multi-container 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/* generators for user systemd services (only for rootless podman)
/etc/containers/systemd/* generators for system systemd services
/usr/share/containers/systemd/* generators for system systemd services (installed by packages)
/usr/lib/podman/quadlet quadlet executable (not on path)

Notes

quadlet install
quadlet usage
quadlet syntax

Examples

quadlet example: single container with volume