---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: pdf-markings-amqp
  namespace: documentations

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

        image:
          name:
            _default: cr.yandex/crp3ccidau046kdj8g9q/pdf-markings-amqp:prod_3ab263be
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: pdf-markings-amqp

          replicaCount:
            _default: 1

          port:
            _default: 8000

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

        service:
          enabled: false

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

        volumes:
          _default:
            - name: yc-s3
              mountPath:
                _default: /etc/sarex/yc-s3-storage
              readOnly:
                _default: true
              secret:
                secretName:
                  _default: yc-s3

        envs:
          - name: MARKS_APP__LOG_LEVEL
            value:
              _default: "INFO"

          - name: MARKS_CRYPTO__HASHING_ALGO
            value:
              _default: "md_gost12_256"

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

          - name: MARKS_DOCUMENTS_DB__PORT
            value:
              _default: "5432"

          - name: MARKS_DOCUMENTS_DB__DATABASE
            value:
              _default: "documentations_db"

          - name: MARKS_DOCUMENTS_DB__SSLMODE
            value:
              _default: "disable"

          - name: MARKS_QR__REDIRECT_URL
            value:
              _default: "https://stamp-verification-srx.wb.ru/"

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

          - name: MARKS_S3__USE_SSL
            value:
              _default: "false"

          - name: MARKS_S3__SSL_VERIFY
            value:
              _default: "false"

          - name: MARKS_S3__REGION
            value:
              _default: "ru-central1"

          - name: MARKS_S3__DEFAULT_BUCKET
            value:
              _default: "documentations-stage-1-sarex-new"

          - name: MARKS_RABBITMQ__ROUTING__INPUT_QUEUE
            value:
              _default: "pdf_markings_input"

        secretEnvs:
          - name: MARKS_DOCUMENTS_DB__USERNAME
            secretName:
              _default: "postgres-secret"
            secretKey: "username"

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

          - name: MARKS_S3__URL
            secretName:
              _default: "yc-s3"
            secretKey: "endpoint_url"

          - name: MARKS_S3__ACCESS_KEY
            secretName:
              _default: "yc-s3"
            secretKey: "key_id"

          - name: MARKS_S3__SECRET_KEY
            secretName:
              _default: "yc-s3"
            secretKey: "access_key"

          - name: MARKS_RABBITMQ__HOST
            secretName:
              _default: "rabbitmq"
            secretKey: "host"

          - name: MARKS_RABBITMQ__PORT
            secretName:
              _default: "rabbitmq"
            secretKey: "port"

          - name: MARKS_RABBITMQ__USERNAME
            secretName:
              _default: "rabbitmq"
            secretKey: "username"

          - name: MARKS_RABBITMQ__PASSWORD
            secretName:
              _default: "rabbitmq"
            secretKey: "password"

          - name: MARKS_RABBITMQ__VHOST
            secretName:
              _default: "rabbitmq"
            secretKey: "vhost"

          - name: MARKS_RABBITMQ__HEARTBEAT_SECONDS
            secretName:
              _default: "rabbitmq"
            secretKey: "heartbeat"

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