Files
ansible-playbooks/roles/ntfy/templates/ntfy.yaml.j2
T
Clément Désiles a8545fc501 fix(podman): use Type=notify + service-container so systemd sees pod crashes
The previous Type=oneshot + RemainAfterExit=true pattern made systemd
freeze pod units in 'active (exited)' as soon as 'podman play kube'
returned, so crash-looping containers were invisible to
'systemctl --user --failed' and Restart=on-failure never fired.

For every podman-pod role (immich, fdroid, ntfy, gitea, qfieldcloud,
unifi, matrix, uptime_kuma):

- switch units to Type=notify + NotifyAccess=all
- run 'podman kube play --service-container=true' so the unit's main
  PID stays alive as long as the pod
- use 'podman kube down' for ExecStop
- add TimeoutStartSec=180 to cover slow first-boot image pulls

Pod manifests: flip every container's restartPolicy from Always to
Never. systemd is now the single owner of the restart loop: container
exits -> pod dies -> service container dies -> unit fails ->
Restart=on-failure restarts everything cleanly. With Always, podman
retried internally and hid the failure from systemd.

CLAUDE.md updated to document the new canonical template and the
'restartPolicy: Never' requirement.
2026-05-29 21:49:13 +02:00

58 lines
1.3 KiB
Django/Jinja

---
apiVersion: v1
kind: Pod
metadata:
name: ntfy
labels:
app: ntfy
spec:
containers:
- name: server
image: {{ ntfy_image }}:{{ ntfy_version }}
args:
- serve
ports:
- containerPort: 80
hostPort: {{ ntfy_port }}
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: ntfy-config
mountPath: /etc/ntfy/server.yml
readOnly: true
- name: ntfy-cache
mountPath: /var/cache/ntfy
- name: ntfy-data
mountPath: /var/lib/ntfy
livenessProbe:
exec:
command:
- wget
- -q
- -O-
- http://localhost:80/v1/health
initialDelaySeconds: 40
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
restartPolicy: Never
volumes:
- name: localtime
hostPath:
path: /etc/localtime
type: File
- name: ntfy-config
hostPath:
path: {{ podman_projects_dir | default('/opt/podman') }}/ntfy/server.yml
type: File
- name: ntfy-cache
hostPath:
path: {{ ntfy_cache_dir }}
type: Directory
- name: ntfy-data
hostPath:
path: {{ ntfy_data_dir }}
type: Directory