apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: backend
  namespace: checklist

spec:
  interval: 10m

  chart:
    spec:
      chart: universal-chart
      version: "0.1.7"
      sourceRef:
        kind: HelmRepository
        name: yc-oci-charts
        namespace: flux-system
      interval: 10m

  install:
    remediation:
      retries: 3

  upgrade:
    remediation:
      retries: 3

  values:
    global:
      env: _default

    services:
      backend:
        enabled: true

        image:
          name:
            _default: cr.yandex/crp3ccidau046kdj8g9q/checklists-backend:preprod_b1980fc6
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: backend

          replicaCount:
            _default: 1
            stage: 1
            preprod: 3
            production: 3

          port:
            _default: 8000

          probes:
            liveness:
              enabled: false
            readiness:
              enabled: false

        service:
          enabled: true

          name:
            _default: backend-service

          type:
            _default: ClusterIP

          port:
            _default: 8000

          targetPort:
            _default: 8000

          portName:
            _default: http

        imagePullSecrets:
          enabled:
            _default: true
          name:
            _default: regcred
        labels:
          monitoring: prometheus

        envs:
          - name: HTTP_APP_HOST
            value:
              _default: "0.0.0.0"

          - name: HTTP_APP_PORT
            value:
              _default: "8000"

          - name: HTTP_APP_ROOT_PATH
            value:
              _default: "/checklists"

          - name: HTTP_APP_WORKERS
            value:
              _default: "8"

          - name: HTTP_APP_ADMIN_ENABLE
            value:
              _default: "true"

          - name: JWT_AUTH_ENABLE
            value:
              _default: "true"

          - name: DEBUG
            value:
              _default: "false"
        secretEnvs:
          - name: DATABASE_HOST
            secretName:
              _default: "checklists-postgresql-secret"
            secretKey: "hostname"

          - name: DATABASE_PORT
            secretName:
              _default: "checklists-postgresql-secret"
            secretKey: "port"

          - name: DATABASE_NAME
            secretName:
              _default: "checklists-postgresql-secret"
            secretKey: "database"

          - name: DATABASE_USER
            secretName:
              _default: "checklists-postgresql-secret"
            secretKey: "username"

          - name: DATABASE_PASSWORD
            secretName:
              _default: "checklists-postgresql-secret"
            secretKey: "password"

          - name: JWT_AUTH_PUBLIC_KEY
            secretName:
              _default: "checklists-public-key"
            secretKey: "key"

        commitSha: ""
        gitlabUri: ""
        gitlabJobUrl: ""
        owner: ""