# Default values for CHAP Umbrella Chart

# -- Common labels applied to all Kubernetes resources.
# When deploying via IM, set these to the IM-required labels so they propagate to all pods.
commonLabels: {}

chap-db:
  enabled: true
  fullnameOverride: "chap-db"
  postgresql:
    password: chap
    cnpg:
      cluster:
        enabled: true
        instances: 1
        storageSize: 10Gi
        version: "17"
        database: chap_core
    external:
      enabled: false
  commonLabels: {}

valkey:
  enabled: true
  fullnameOverride: "chap-valkey"
  auth:
    enabled: true
    aclUsers:
      default:
        password: chap
        permissions: "~* &* +@all"
  persistence:
    enabled: true
    size: 10Gi
  commonLabels: {}

chap-api:
  enabled: true
  fullnameOverride: "chap-api"
  image:
    repository: ghcr.io/dhis2-chap/chap-core
    pullPolicy: IfNotPresent
    tag: ""
  replicaCount: 1
  command:
    - gunicorn
    - -c
    - gunicorn.conf.py
    - -k
    - uvicorn.workers.UvicornWorker
    - chap_core.rest_api.app:app
    - --bind
    - 0.0.0.0:8000
  resources: {}
  volumeMounts: []
  serviceAccount:
    create: true
    automount: true
    annotations: {}
    name: ""
  livenessProbe:
    httpGet:
      path: /health
      port: http
    initialDelaySeconds: 30
    periodSeconds: 10
    timeoutSeconds: 5
    failureThreshold: 3
  readinessProbe:
    httpGet:
      path: /health
      port: http
    initialDelaySeconds: 10
    periodSeconds: 5
    timeoutSeconds: 3
    failureThreshold: 3
  autoscaling:
    enabled: false
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: []
  affinity: {}
  service:
    type: ClusterIP
    port: 8000
  ingress:
    enabled: false
    className: ""
    annotations: {}
    hosts:
      - host: chart-example.local
        paths:
          - path: /
            pathType: ImplementationSpecific
    tls: []
  postgres:
    host: "chap-db-postgres-rw"
    port: 5432
    database: chap_core
    existingSecret: "chap-db-postgres"
    secretKeys:
      username: username
      password: password
  valkey:
    host: "chap-valkey"
    port: 6379
    existingSecret: "chap-valkey-auth"
    secretKeys:
      password: default-password
  commonLabels: {}

chap-worker:
  enabled: true
  fullnameOverride: "chap-worker"
  image:
    repository: ghcr.io/dhis2-chap/chap-worker
    pullPolicy: IfNotPresent
    tag: ""
  replicaCount: 1
  command:
    - celery
    - -A
    - chap_core.rest_api.celery_tasks
    - worker
    - --loglevel=info
  resources: {}
  volumeMounts: []
  serviceAccount:
    create: true
    automount: true
    annotations: {}
    name: ""
  livenessProbe:
    exec:
      command:
        - celery
        - -A
        - chap_core.rest_api.celery_tasks
        - inspect
        - ping
    initialDelaySeconds: 30
    periodSeconds: 10
    timeoutSeconds: 5
    failureThreshold: 3
  readinessProbe:
    exec:
      command:
        - celery
        - -A
        - chap_core.rest_api.celery_tasks
        - inspect
        - ping
    initialDelaySeconds: 10
    periodSeconds: 30
    timeoutSeconds: 10
    failureThreshold: 3
  autoscaling:
    enabled: false
    minReplicas: 1
    maxReplicas: 100
    targetCPUUtilizationPercentage: 80
  nodeSelector: {}
  tolerations: []
  affinity: {}
  postgres:
    host: "chap-db-postgres-rw"
    port: 5432
    database: chap_core
    existingSecret: "chap-db-postgres"
    secretKeys:
      username: username
      password: password
  valkey:
    host: "chap-valkey"
    port: 6379
    existingSecret: "chap-valkey-auth"
    secretKeys:
      password: default-password
  commonLabels: {}
