apiVersion: apps/v1 kind: StatefulSet metadata: name: gotify-postgresql namespace: gotify spec: replicas: 1 selector: matchLabels: app: gotify-postgresql serviceName: gotify-postgresql template: metadata: labels: app: gotify-postgresql spec: restartPolicy: Always terminationGracePeriodSeconds: 60 containers: - name: gotify-postgresql image: postgres:18 resources: requests: cpu: 100m memory: 256Mi limits: cpu: 500m memory: 512Mi ports: - containerPort: 5432 volumeMounts: - name: gotify-postgresql-database mountPath: /var/lib/postgresql/pgdata env: - name: PGDATA value: /var/lib/postgresql/pgdata/data - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: gotify-secrets key: db_password - name: POSTGRES_USER valueFrom: secretKeyRef: name: gotify-secrets key: db_user - name: POSTGRES_DB valueFrom: secretKeyRef: name: gotify-secrets key: db_name volumes: - name: gotify-postgresql-database persistentVolumeClaim: claimName: gotify-postgresql-pvc