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

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/rfi-backend:dev4
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: rfi-backend-api

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

          port:
            _default: 8000


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

        service:
          enabled: true

          name:
            _default: rfi-backend-api-svc

          type:
            _default: ClusterIP

          port:
            _default: 80

          targetPort:
            _default: 8000

          portName:
            _default: http

        imagePullSecrets:
          enabled:
            _default: true
          name:
            _default: regcred

        labels:
          monitoring: prometheus
        envs:
          - name: JWT_AUTH_ENABLE
            value:
              _default: "True"

          - name: NOTIFICATIONS_ENABLE
            value:
              _default: "false"

          - name: NOTIFICATIONS_EMAIL_FROM
            value:
              _default: "hello@sarex.io"

          - name: NOTIFICATIONS_SERVICE_URL
            value:
              _default: "https://cde.brusnika.ru/rfi"

          - name: SAREX_BACKEND_URL
            value:
              _default: "http://backend.django.svc.cluster.local:8000"

          - name: EAV_URL
            value:
              _default: "http://eav-service.eav.svc.cluster.local:8000"

          - name: GATEWAY_URL
            value:
              _default: "http://pdm-api.documentations.svc.cluster.local:8080"

          - name: RABBITMQ_PORT
            value:
              _default: "5672"

          - name: RABBITMQ_HOST
            value:
              _default: "rabbitmq.rabbitmq.svc.cluster.local"

          - name: DB_HOST
            value:
              _default: "postgres-service"

          - name: DB_PORT
            value:
              _default: "5432"
        secretEnvs:
          - name: DJANGO_SECRET_KEY
            secretName:
              _default: "django-secret"
            secretKey: "django_secret_key"

          - name: DB_NAME
            secretName:
              _default: "postgres-secret"
            secretKey: "dbname"

          - name: DB_USER
            secretName:
              _default: "postgres-secret"
            secretKey: "user"

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

          - name: SAREX_BACKEND_AUTH
            secretName:
              _default: "django-secret"
            secretKey: "token"

          - name: YC_S3_ACCESS_KEY_ID
            secretName:
              _default: "s3-secret"
            secretKey: "key_id"

          - name: YC_S3_SECRET_ACCESS_KEY
            secretName:
              _default: "s3-secret"
            secretKey: "access_key"

          - name: YC_S3_BUCKET_NAME
            secretName:
              _default: "s3-secret"
            secretKey: "storage_bucket_name"

          - name: YC_S3_ENDPOINT_URL
            secretName:
              _default: "s3-secret"
            secretKey: "endpoint_url"

          - name: RABBITMQ_VHOST
            secretName:
              _default: "rabbitmq-secret"
            secretKey: "vhost"

          - name: RABBITMQ_USERNAME
            secretName:
              _default: "rabbitmq-secret"
            secretKey: "username"

          - name: RABBITMQ_PASSWORD
            secretName:
              _default: "rabbitmq-secret"
            secretKey: "password"

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