# Default values for the {{projectName}} chart.
# Override these per-env in values-dev.yaml / values-staging.yaml / values-prod.yaml.

global:
  imagePullPolicy: IfNotPresent
  imageRegistry: ""     # e.g. ghcr.io/your-org — empty means use local image

# ---------- API service ----------
api:
  enabled: true
  image:
    repository: {{projectName}}-api
    tag: latest
  replicaCount: 1
  port: 4000
  resources:
    requests: { cpu: 100m, memory: 256Mi }
    limits:   { cpu: 500m, memory: 512Mi }
  env: {}
  # env:
  #   LOG_LEVEL: info

# ---------- Web service ----------
web:
  enabled: true
  image:
    repository: {{projectName}}-web
    tag: latest
  replicaCount: 1
  port: 5173
  resources:
    requests: { cpu: 100m, memory: 256Mi }
    limits:   { cpu: 500m, memory: 512Mi }

# ---------- Database dialect switch ----------
# 'postgres' uses the postgres block below (embedded StatefulSet or
# external). 'mariadb' uses an EXTERNALLY-managed MariaDB (the company
# cluster) reached via a Secret holding the connection url — no embedded
# DB is shipped to prod. MariaDB turns on binlog CDC; it REQUIRES
# binlog_format=ROW + binlog_row_image=FULL + a replication grant on the
# server, and api.replicaCount > 1 needs the per-pod POD_NAME/POD_IP
# downward-API injection (wired in deployment-api.yaml).
db:
  dialect: postgres   # postgres | mariadb
  mariadb:
    # Secret with key `url` = mysql://user:pass@host:3306/dbname.
    # The DB user must hold REPLICATION SLAVE, REPLICATION CLIENT.
    urlSecretName: ""
    cdc: "1"

# ---------- Postgres (used when db.dialect=postgres) ----------
postgres:
  # Embedded = StatefulSet inside the cluster (fine for dev, not for prod).
  # Set false to point at an externally-managed Postgres.
  embedded: true

  # Used when embedded: true.
  image:
    repository: postgres
    tag: 17-alpine
  storageSize: 5Gi
  storageClassName: ""

  # Connection details (used by api as DB_URL).
  user: app
  database: {{projectNameSnake}}
  # passwordSecretName: existing-secret    # use an existing Secret in prod

  # Used when embedded: false. Point at your managed Postgres URL.
  externalUrl: ""

# ---------- Object storage (S3 / MinIO) ----------
# Blobs (avatars, AI-analysis artifacts) live in object storage; the DB
# holds only refs (_voltro_storage_refs). Disabled by default; enable +
# point at S3 or an in-cluster MinIO.
storage:
  enabled: false
  provider: s3            # s3 | minio | filesystem
  endpoint: ""            # required for minio / non-AWS S3
  bucket: {{projectNameSnake}}
  forcePathStyle: "0"     # "1" for MinIO / path-style endpoints
  # Secret with keys `accessKeyId` + `secretAccessKey`.
  credentialsSecretName: ""

# ---------- Session signing secret ----------
# Set via Secret in prod (see templates/secret.yaml).
sessionSecret: "change-me-in-prod"

# ---------- Ingress ----------
ingress:
  enabled: false
  className: nginx
  hosts:
    - host: {{projectName}}.example.com
      paths:
        - path: /api
          service: api
        - path: /
          service: web
  tls: []
  # tls:
  #   - secretName: {{projectName}}-tls
  #     hosts:
  #       - {{projectName}}.example.com

# ---------- Service account ----------
serviceAccount:
  create: true
  name: ""
