---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: documentations-hasher
  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
  driftDetection:
    mode: enabled

  values:
    global:
      env: _default

    services:
      backend:
        enabled: true

        image:
          name:
            _default: cr.yandex/crp3ccidau046kdj8g9q/hasher:production_3f853d3a
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: hasher

          replicaCount:
            _default: 1

          port:
            _default: 8080

          command:
            _default: ["run-amqp-server"]

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

        service:
          enabled: true

          name:
            _default: hasher-service

          type:
            _default: ClusterIP

          port:
            _default: 8080

          targetPort:
            _default: 8080

          portName:
            _default: http

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

        labels:
          monitoring: prometheus

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

          - name: HASHER_APP__NUM_WORKERS
            value:
              _default: "4"

          - name: HASHER_AMQP__ROUTING__TASK_INPUT_QUEUE
            value:
              _default: "hash.compute.normal.tasks"

          - name: HASHER_AMQP__ROUTING__TASK_INPUT_EXCHANGE
            value:
              _default: "hash.compute"

          - name: HASHER_AMQP__ROUTING__TASK_INPUT_EXCHANGE_TYPE
            value:
              _default: "direct"

          - name: HASHER_AMQP__ROUTING__TASK_INPUT_ROUTING_KEY
            value:
              _default: "hash.compute.normal"

          - name: HASHER_S3__MAX_POOL_CONNECTIONS
            value:
              _default: "10"

          - name: HASHER_S3__CONNECT_TIMEOUT
            value:
              _default: "10"

          - name: HASHER_S3__READ_TIMEOUT
            value:
              _default: "30"

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

          - name: HASHER_S3__USE_SSL
            value:
              _default: "true"

          - name: HASHER_S3__VERIFY
            value:
              _default: "true"

        secretEnvs:
          - name: HASHER_AMQP__HOST
            secretName:
              _default: "rabbitmq"
            secretKey: "host"

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

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

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

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

          - name: HASHER_S3__ENDPOINT
            secretName:
              _default: "hasher-s3-secret"
            secretKey: "endpoint"

          - name: HASHER_S3__ACCESS_KEY
            secretName:
              _default: "hasher-s3-secret"
            secretKey: "access_key"

          - name: HASHER_S3__SECRET_KEY
            secretName:
              _default: "hasher-s3-secret"
            secretKey: "secret_key"

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