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

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:
      checklists-backend:
        enabled: true

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

        deployment:
          enabled: true

          name:
            _default: checklists-backend

          replicaCount:
            _default: 1

          port:
            _default: 80

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

        service:
          enabled: true

          name:
            _default: checklists-backend-service

          type:
            _default: ClusterIP

          port:
            _default: 80

          targetPort:
            _default: 8000

          portName:
            _default: http

        imagePullSecrets:
          enabled:
            _default: true
          name:
            _default: dockerhub

        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: DATABASE_HOST
            value:
              _default: "sarex-vpsql-01.xc.wb.ru"

          - name: DATABASE_PORT
            value:
              _default: "5432"

          - name: DATABASE_NAME
            value:
              _default: "checklists_db"

          - name: JWT_AUTH_ENABLE
            value:
              _default: "true"

          - name: DEBUG
            value:
              _default: "false"

        secretEnvs:
          - name: DATABASE_USER
            secretName:
              _default: "postgres-secret"
            secretKey: "user"

          - name: DATABASE_PASSWORD
            secretName:
              _default: "postgres-secret"
            secretKey: "password"

          - name: JWT_AUTH_PUBLIC_KEY
            secretName:
              _default: "jwt-secret"
            secretKey: "public-key"

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