Files
ansible-playbooks/roles/gitea/templates/gitea.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

55 lines
1.6 KiB
Django/Jinja

---
apiVersion: v1
kind: Pod
metadata:
name: gitea
labels:
app: gitea
spec:
containers:
- name: server
image: {{ gitea_image }}:{{ gitea_version }}
ports:
- containerPort: {{ gitea_port }}
hostPort: {{ gitea_port }}
env:
- name: GITEA__database__DB_TYPE
value: postgres
- name: GITEA__database__HOST
value: {{ immich_postgres_host | default('127.0.0.1') }}
- name: GITEA__database__PORT
value: "5432"
- name: GITEA__database__NAME
value: "{{ gitea_postgres_db_name }}"
- name: GITEA__database__USER
value: "{{ gitea_postgres_user }}"
- name: GITEA__database__PASSWD
value: "{{ gitea_postgres_password }}"
- name: GITEA__server__DOMAIN
value: "{{ gitea_domain }}"
- name: GITEA__server__ROOT_URL
value: "{{ gitea_root_url }}"
- name: GITEA__server__HTTP_PORT
value: "{{ gitea_port }}"
- name: GITEA__server__DISABLE_SSH
value: "{{ 'true' if gitea_disable_ssh else 'false' }}"
- name: GITEA__service__DISABLE_REGISTRATION
value: "{{ 'true' if gitea_disable_registration else 'false' }}"
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: gitea-data
mountPath: /data
restartPolicy: Never
volumes:
- name: localtime
hostPath:
path: /etc/localtime
type: File
- name: gitea-data
hostPath:
path: {{ gitea_data_dir }}
type: Directory