Files
ApiCore/deploy/k8s/postgres/statefulset.yaml
T
Nick SzaunigandClaude Opus 5.5 cde817845e
Backend Image / build-and-push (push) Successful in 3m9s
Frontend Image / build-and-push (push) Canceled after 2m1s
chore(k8s): drop CPU and memory requests
Requests are set to an explicit 0 instead of being removed, because
Kubernetes defaults a missing request to the limit, which would reserve
even more. Limits stay as an upper bound.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-10 04:08:07 +02:00

58 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: apicore-postgres
spec:
serviceName: apicore-postgres
replicas: 1
selector:
matchLabels:
app: apicore-postgres
template:
metadata:
labels:
app: apicore-postgres
spec:
containers:
- name: postgres
image: postgres:18.6-alpine
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: apicore-postgres-secret
env:
# Unterordner statt Mount-Root: Postgres' initdb verlangt ein
# leeres Datenverzeichnis, der Mount-Root von PersistentVolumes
# enthaelt aber oft ein verstecktes "lost+found"-Verzeichnis.
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
livenessProbe:
exec:
command: ["pg_isready", "-U", "$(POSTGRES_USER)", "-d", "$(POSTGRES_DB)"]
initialDelaySeconds: 30
periodSeconds: 15
readinessProbe:
exec:
command: ["pg_isready", "-U", "$(POSTGRES_USER)", "-d", "$(POSTGRES_DB)"]
initialDelaySeconds: 10
periodSeconds: 10
resources:
requests:
cpu: "0"
memory: "0"
limits:
cpu: "1"
memory: 1Gi
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi