a8545fc501
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.
64 lines
1.5 KiB
Django/Jinja
64 lines
1.5 KiB
Django/Jinja
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: matrix
|
|
labels:
|
|
app: matrix
|
|
spec:
|
|
containers:
|
|
- name: synapse
|
|
image: {{ synapse_image }}:{{ synapse_version }}
|
|
ports:
|
|
- containerPort: 8008
|
|
hostPort: {{ synapse_port }}
|
|
{% if synapse_enable_federation %}
|
|
- containerPort: 8448
|
|
hostPort: {{ synapse_federation_port }}
|
|
{% endif %}
|
|
env:
|
|
- name: SYNAPSE_CONFIG_PATH
|
|
value: /data/homeserver.yaml
|
|
- name: TZ
|
|
value: "{{ matrix_timezone }}"
|
|
volumeMounts:
|
|
- name: localtime
|
|
mountPath: /etc/localtime
|
|
readOnly: true
|
|
- name: synapse-data
|
|
mountPath: /data
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8008
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
timeoutSeconds: 10
|
|
failureThreshold: 3
|
|
restartPolicy: Never
|
|
|
|
- name: element
|
|
image: {{ element_image }}:{{ element_version }}
|
|
ports:
|
|
- containerPort: 80
|
|
hostPort: 8080
|
|
volumeMounts:
|
|
- name: element-config
|
|
mountPath: /app/config.json
|
|
subPath: config.json
|
|
restartPolicy: Never
|
|
|
|
volumes:
|
|
- name: localtime
|
|
hostPath:
|
|
path: /etc/localtime
|
|
type: File
|
|
- name: synapse-data
|
|
hostPath:
|
|
path: {{ synapse_data_dir }}
|
|
type: Directory
|
|
- name: element-config
|
|
hostPath:
|
|
path: {{ element_data_dir }}
|
|
type: Directory
|