# Default values for stateful-application
# Stateful applications require persistent storage and stable network identities

replicaCount: 3

image:
  repository: postgres
  pullPolicy: IfNotPresent
  tag: "16-alpine"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
  create: true
  annotations: {}
  name: ""

podAnnotations: {}
podLabels: {}

podSecurityContext:
  runAsNonRoot: true
  runAsUser: 999
  fsGroup: 999

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
    - ALL
  runAsNonRoot: true
  runAsUser: 999

service:
  type: ClusterIP
  port: 5432
  # Headless service for StatefulSet
  clusterIP: None

# Persistent Volume Claims for StatefulSet
volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "standard"
      resources:
        requests:
          storage: 10Gi

resources:
  limits:
    cpu: 1000m
    memory: 1Gi
  requests:
    cpu: 500m
    memory: 512Mi

# Update strategy for StatefulSet
updateStrategy:
  type: RollingUpdate
  rollingUpdate:
    partition: 0

# Pod Management Policy
podManagementPolicy: OrderedReady

# Service name for stable network identity
serviceName: ""

env:
  - name: POSTGRES_PASSWORD
    valueFrom:
      secretKeyRef:
        name: postgres-secret
        key: password

livenessProbe:
  exec:
    command:
      - /bin/sh
      - -c
      - pg_isready -U postgres
  initialDelaySeconds: 30
  periodSeconds: 10

readinessProbe:
  exec:
    command:
      - /bin/sh
      - -c
      - pg_isready -U postgres
  initialDelaySeconds: 5
  periodSeconds: 5

nodeSelector: {}
tolerations: []
affinity: {}

# Init containers for setup
initContainers: []

# Additional volumes
volumes: []
volumeMounts: []
