Files
k8s-manifests/authentik/statefulset-postgresql.yaml
T
chemavxandClaude Opus 4.8 77b0b2385d authentik: repoint postgres sts POSTGRES_PASSWORD to authentik-secrets-infisical
Postgres-first cutover step. Already-initialized PG17 ignores POSTGRES_PASSWORD
on restart (role pw in pg_authid), so this byte-identical roll is benign.
StatefulSet RollingUpdate is ordered terminate-then-create (no two-postmaster
surge), so no Recreate flip. Applied via kubectl (not ArgoCD-managed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 11:14:52 +00:00

75 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql
namespace: authentik
spec:
persistentVolumeClaimRetentionPolicy:
whenDeleted: Retain
whenScaled: Retain
podManagementPolicy: OrderedReady
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: postgresql
serviceName: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- env:
- name: POSTGRES_USER
value: authentik
- name: POSTGRES_DB
value: authentik
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: authentik-secrets-infisical
- name: PGDATA
value: /var/lib/postgresql/data
image: postgres:17-alpine
imagePullPolicy: IfNotPresent
name: postgresql
ports:
- containerPort: 5432
protocol: TCP
readinessProbe:
exec:
command:
- pg_isready
- -U
- authentik
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: pg-data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 999
runAsGroup: 999
runAsUser: 999
terminationGracePeriodSeconds: 30
volumes:
- name: pg-data
persistentVolumeClaim:
claimName: authentik-pg-pvc
updateStrategy:
rollingUpdate:
partition: 0
type: RollingUpdate