Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you just need to write a short systemd config snippet and then you can manage the kube service just like any other systemd service.

Just FYI, `podman generate systemd --files --name mypod` will create all the systemd service files for you.

https://docs.podman.io/en/latest/markdown/podman-generate-sy...





`podman generate systemd` was created as a bandaid because it was so difficult to manually write systemd units.

Quadlets now make it much easier to create the units by hand, and ‘ `podman generate systemd` is deprecated.


I appreciate the correction. Its been a while since I used podman + systemd. I will definitely be checking out quadlets next time.

Be sure to podlet for automating the creation of the quadlet config files!

yeah Quadlets are a pretty reasonable improvement.

It was introduced in Podman 4.4 which is circa 2023.

And it takes a while for podman to get up to date in non-Redhat related distributions. Like Debian Stable was stuck on 4.3 until Trixie release this month.

So unless you are using Fedora and friends or something like Arch it is kinda hard time going for podman users. Which is unfortunate.

Docker has a bit of a advantage here because they encourage you to use their packages, not the distribution's.

Here is a example Quadlet configuration i use for syncthing that I run out of my home:

  [Unit]
  Description=syncthing
  After=default.target
  
  [Container]
  ContainerName=syncthing
  Image=docker://docker.io/syncthing/syncthing:latest
  Volume=/home/lothar/.syncthing:/var/syncthing:z
  Volume=/home/lothar:/var/home/:rslave
  Network=host
  Pull=always
  Environment=PUID=1000
  Environment=PGID=1000
  Environment=STGUIADDRESS=''
  UserNS=keep-id:uid=1000,gid=1000
  SecurityLabelDisable=true
  
  [Install]
  WantedBy=multi-user.target default.target

This then gets dropped into ~/.config/containers/systemd/syncthing.container

And it is handled automatically.

This configures the syncthing container to always get updated on each startup, bypasses the "rootless" networking by using host networking (rootless networking is limited and slow), and the default Sync dir ends up in ~/.syncthing where as I can add more sync'd directories to my real home directory by directing it to /var/home/ in the syncthing web ui.

As you can see the arguments under "container" is just really capitalized versions of docker/podman arguments.

Also if you like GUIs the podman desktop has support for helping to generating quadlets. Although I haven't tried it out yet.


Echoing the other comment that quadlet is the way to go here



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: