fullnameOverride: umami

image:
  tag: postgresql-latest

# Disable PostgreSQL subchart (using external PostgreSQL)
postgresql:
  enabled: false

# External database configuration
externalDatabase:
  type: postgresql
  hostname: postgresql-rw.postgresql.svc.cluster.local
  port: 5432
  auth:
    database: umami
    username: bluemayne
    # Password is managed via External Secrets Operator (Vault)

# Use existing secret for sensitive data
database:
  existingSecret: umami-password

# Environment variables from secret
envFrom:
  - secretRef:
      name: umami-password

# Disable login (using Authelia for authentication)
env:
  DISABLE_LOGIN: "1"

ingress:
  enabled: false  # Will use our main ingress

service:
  type: ClusterIP
  port: 3000

resources:
  requests:
    cpu: 15m
    memory: 384Mi
  limits:
    memory: 576Mi

replicaCount: 2

# Autoscaling
autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 4
  targetCPUUtilizationPercentage: 80

# Health checks
startupProbe:
  enabled: true
  httpGet:
    path: /api/heartbeat
    port: 3000
  periodSeconds: 10
  failureThreshold: 30

livenessProbe:
  enabled: true
  httpGet:
    path: /api/heartbeat
    port: 3000
  initialDelaySeconds: 0
  periodSeconds: 10

readinessProbe:
  enabled: true
  httpGet:
    path: /api/heartbeat
    port: 3000
  initialDelaySeconds: 0
  periodSeconds: 5

# Affinity - Soft Anti-Affinity to spread pods across nodes
affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchLabels:
              app.kubernetes.io/name: umami
          topologyKey: kubernetes.io/hostname
