---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: celery
  namespace: flows

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:
      celery:
        enabled: true

        image:
          name:
            _default: cr.yandex/crp3ccidau046kdj8g9q/flows-backend_worker:production_a7dc8216
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: celery

          replicaCount:
            _default: 1

          port:
            _default: 8000

          command:
            _default: ["celery", "-A", "src.worker", "worker", "-l", "INFO", "-E", "--concurrency=1", "-Q", "flow"]

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

        service:
          enabled: false

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

        volumes:
          _default:
            - name: kafka-configmap
              mountPath:
                _default: /opt/src/flow/kafka.py
              subPath:
                _default: kafka.py
              readOnly:
                _default: true
              configMap:
                name:
                  _default: kafka-configmap
                items:
                  - key: kafka.py
                    path:
                      _default: kafka.py

        envs:
          - name: KAFKA_HOST
            value:
              _default: "wb-prod-kafka-bootstrap.kafka.svc.cluster.local:9093"

          - name: KAFKA_SSL_CERT
            value:
              _default: |
                -----BEGIN CERTIFICATE-----
                MIIFLTCCAxWgAwIBAgIUYDZPxGRsr7IiqHEmfd07QTQlOKYwDQYJKoZIhvcNAQEN
                BQAwLTETMBEGA1UECgwKaW8uc3RyaW16aTEWMBQGA1UEAwwNY2x1c3Rlci1jYSB2
                MDAeFw0yNTEyMTYxNDM0NTVaFw0yNjEyMTYxNDM0NTVaMC0xEzARBgNVBAoMCmlv
                LnN0cmltemkxFjAUBgNVBAMMDWNsdXN0ZXItY2EgdjAwggIiMA0GCSqGSIb3DQEB
                AQUAA4ICDwAwggIKAoICAQCfzDZhEzw2pbU5Xpu8OzD+3iQG+DVjU8PQWWQEF27h
                yjohDkUr3zCZtW7xMKWKUNxBgrKsfe4TDOQN8cij3cS9sy0So+UhMeF7Bq9PU1Yd
                bmTRq8q1PiuNUkiCGJ5wrb3+NZvVxZLJUIFgiealsRw80MgMWWSzy0I35T2Edn/a
                DU4jhlgQxyzQ621+oGP0n28gCjmm6pCq2tkj/Z8WTdu1gOWyRdK02a2uE2Ts2nLa
                Di32GaZrIbIuD/WUd6Ek66uCeJvh2CT7s+SqgtMbtT7gibUuPQ3hk1VGQsjy22l3
                hUNpLu86nrwbuf21mY55KnLOcaVq1ag1TpIIKfZAL/KWFCGZ6H6kwEIbCAL0Hei7
                cJ2Wm2/qlzKUeU869M7YybZAfXl/t6XT4QgFgje+42N980vy5A4GhWi1Z7lPqqOe
                jPGBstkRZybKz1sTk87+oJx82iQU/ozVmzjSEK1SoYRNbvug8PNpxmPoPnJ2flgG
                t2q2+2ZQP3f1aAHVcZ3U5+hWlRmKPXzjrJv7gnhuvqJl7OwB50y+yWiVfZ9xrYl2
                EpX+yHuFFK+9NnB5taUK8Fz+hQaLU8J4q7P0bRqkoI+LdcEErjuDT/eI2d5+Ql8K
                /JkV823hX2WNB9bdaQ24BelVUbsxGpR7ms6KWrM11kHnbzUlEM+AxZES6F7Qbr55
                TwIDAQABo0UwQzAdBgNVHQ4EFgQUM7hshx7e9TFEN82Pf446aBrJUA4wEgYDVR0T
                AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQADggIB
                AFNHFGPDxY966fz0dxDFFSfeo47y7XQZMK9xAwH73cQoSeqx+IMxzgM8nfJQ9XMN
                PeLwVRZ7pvRee2ZhUPglBSTHnW2rvfmLBOO9xyKZxRsCkoFxuHH9xfM7bFWb96R6
                fGrOdEZDB3yj00T+tkubwqt+/dUhQUj8juwyPs55WMb/0BIbapaoQ6QOP13CaXDV
                ZmAfsEEIBkNxfq7GTr/z0Rq0B4+9FxAf3Jrsmi/dYoFD/prHsvBDkYw1daoFyp5C
                tbctvB9wtphnCCynekt8UBvpVKHUU/xaUa09TQTToXjBbV1SZeIOHNG0MNbWa4sz
                AL/cpXdq1EAxiTeAVT9XhCwhe/xJvFZIWuFLmW3J+ZxrOUCKieCYpTqBY2tBkkDY
                //egic787yTR6zxqQNSzvNU5LhzrN7lu+KHGM06T35+HvpzgPPiRCzsxO62p63op
                mq04K31yYZgLiqeAj5W+rioRGJNn4TXJpH9KIrzmGM7lVWLYWMAKeZU4r1lDUdcu
                7jsBH8BRJWJeVK3xVw2HB3lk7Xn0WrR92adeYQ3f0vKbMIAVUnSJ3yCKJ4NMFSki
                j78nx2mi/G0RhUPGZ9hhLXQKj9BtbpEnwpbGWtf0ShtVOxD/HKLCr7koBtW9TMPS
                9K0sJhE5VjsQLkDDu9p3GdRcuLNA/oa7xFvRFtqGFsLj
                -----END CERTIFICATE-----

          - name: LOG_LEVEL
            value:
              _default: "DEBUG"

          - name: FLOWS_HOST
            value:
              _default: "http://backend-service.flows.svc.cluster.local:8000"

          - name: DOCUMENTATION_PG_PORT
            value:
              _default: "5432"

          - name: DOCUMENTATION_PG_DATABASE
            value:
              _default: "documentations_db"

          - name: DOCUMENTATION_PG_HOST
            value:
              _default: "sarex-vpsql-01.xc.wb.ru"

          - name: BASE_HOST
            value:
              _default: "https://lk.srx.wb.ru:30443"

          - name: CELERY_QUEUE
            value:
              _default: "flow"

          - name: RESOURCES_HOST
            value:
              _default: "http://resources-service.resources.svc.cluster.local:8000/"

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

          - name: DOCUMENTATION_HOST
            value:
              _default: "http://documentations-api.documentations.svc.cluster.local:8080/internal/v1"

          - name: DOCUMENTATION_EXTERNAL_HOST
            value:
              _default: "http://documentations-api.documentations.svc.cluster.local:8080/api/v1"

          - name: ENABLE_ANALYTICS
            value:
              _default: "1"

          - name: FLOWS_DB_HOST
            value:
              _default: "sarex-vpsql-01.xc.wb.ru"

          - name: FLOWS_DB_PORT
            value:
              _default: "5432"

          - name: ISSUES_DB_PORT
            value:
              _default: "5432"

          - name: ISSUES_DB_HOST
            value:
              _default: "sarex-vpsql-01.xc.wb.ru"

          - name: ENABLE_CELERY
            value:
              _default: "1"

          - name: ENABLE_MAILGUN
            value:
              _default: "0"

          - name: ENABLE_METRICS
            value:
              _default: "0"

          - name: FROM_EMAIL
            value:
              _default: "wb@wb.ru"

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

          - name: PG_HOST
            value:
              _default: "sarex-vpsql-01.xc.wb.ru"

          - name: PG_PORT
            value:
              _default: "5432"

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

          - name: RABBITMQ_PORT
            value:
              _default: "5672"

          - name: DJANGO_BASE_HOST
            value:
              _default: "https://srx.wb.ru"

          - name: RESOURCE_URL
            value:
              _default: "http://resources-service.resources.svc.cluster.local:8000"

          - name: SERVICE_HOST
            value:
              _default: "https://lk.srx.wb.ru:30443/flows/api/v1"

          - name: SMTP_HOST
            value:
              _default: "smtp-relay.wb.com"

          - name: SMTP_PORT
            value:
              _default: "587"

          - name: SYNC_RESOURCE_ID
            value:
              _default: "1"

          - name: TIMEOUT
            value:
              _default: "120"

          - name: WORKFLOWS_HOST
            value:
              _default: "http://workflows-api-service.workflow.svc.cluster.local:8000/api/v1"

          - name: WORKFLOWS_TIMEOUT
            value:
              _default: "60"

          - name: DOCUMENTATION_TIMEOUT
            value:
              _default: "60"

        secretEnvs:
          - name: ADMIN_PANEL_SECRET_KEY
            secretName:
              _default: "admin-secret"
            secretKey: "key"

          - name: JWT_PUBLIC_KEY
            secretName:
              _default: "jwt-secret"
            secretKey: "public_key"

          - name: DOCUMENTATION_PG_USERNAME
            secretName:
              _default: "postgres-secret-documentations"
            secretKey: "username"

          - name: DOCUMENTATION_PG_PASSWORD
            secretName:
              _default: "postgres-secret-documentations"
            secretKey: "password"

          - name: FLOWS_DB_DB
            secretName:
              _default: "postgres-secret"
            secretKey: "database"

          - name: FLOWS_DB_USERNAME
            secretName:
              _default: "postgres-secret"
            secretKey: "username"

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

          - name: ISSUES_DB_DB
            secretName:
              _default: "postgres-secret-issues"
            secretKey: "database"

          - name: ISSUES_DB_USERNAME
            secretName:
              _default: "postgres-secret-issues"
            secretKey: "username"

          - name: ISSUES_DB_PASSWORD
            secretName:
              _default: "postgres-secret-issues"
            secretKey: "password"

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

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

          - name: PG_DB
            secretName:
              _default: "postgres-secret"
            secretKey: "database"

          - name: PG_LOGIN
            secretName:
              _default: "postgres-secret"
            secretKey: "username"

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

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

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

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

          - name: KAFKA_USERNAME
            secretName:
              _default: "kafka-secret"
            secretKey: "username"

          - name: KAFKA_PASSWORD
            secretName:
              _default: "kafka-secret"
            secretKey: "password"

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