Quadlet: Difference between revisions

From wikinotes
 
(10 intermediate revisions by the same user not shown)
Line 30: Line 30:
{| class="wikitable"
{| class="wikitable"
|-
|-
| <code>~/.config/containers/systemd/*.{kube,container,volume,network,yml}</code> || build systemd services from these
| <code>~/.config/containers/systemd/*</code> || generators for user systemd services (only for rootless podman)
|-
|-
|  <code>/usr/libexec/podman/quadlet</code> || quadlet executable (not on path)
| <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>
== Overview ==
{| class="wikitable"
<blockquote>
|-
While quadlet is technically an executable, it's designed to work with systemd commands directly.
| [[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.
 
Here's the TL;DR from the official tutorial:
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
 
You can debug the generated files using
<syntaxhighlight lang="bash">
/usr/libexec/podman/quadlet --dryrun
</syntaxhighlight>
</blockquote><!-- Overview -->
 
== Secrets ==
<blockquote>
<blockquote>
It looks like these are primarily managed using kubernetes own utils from <code>kubectl create secret ${secret}</code>.
{| class="wikitable"
 
|-
{{ TODO |
| [[quadlet example: single container with volume]]
more research is needed here.
|-
}}
|}
</blockquote><!-- Secrets -->
</blockquote><!-- Examples -->
</blockquote><!-- Usage -->
 
= Syntax =
<blockquote>
== Overview ==
<blockquote>
<syntaxhighlight lang="yaml">
# container descriptions
*.container: manages containers using 'podman run'
*.kube:      manage containers defined in kubernetes yaml files using 'podman kube play'
 
# resources
*.network:  create podman networks, referenced in '.container' or '.kube' files
*.volume:    create podman volumes, referenced in '.container' files
</syntaxhighlight>
</blockquote><!-- Overview -->
</blockquote><!-- Syntax -->

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