---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: s3-proxy
  namespace: django

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:
      s3-proxy:
        enabled: true

        image:
          name:
            _default: cr.yandex/crp3ccidau046kdj8g9q/s3-proxy:stable
          pullPolicy:
            _default: IfNotPresent

        deployment:
          enabled: true

          name:
            _default: s3-proxy

          replicaCount:
            _default: 1

          port:
            _default: 80

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

        service:
          enabled: true

          name:
            _default: s3-proxy-service

          type:
            _default: ClusterIP

          port:
            _default: 80

          targetPort:
            _default: 80

          portName:
            _default: http

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

        envs:
          - name: AWS_API_ENDPOINT
            value:
              _default: "http://10.49.10.90:9000"

          - name: ACCESS_LOG
            value:
              _default: "true"

          - name: CORS_ALLOW_HEADERS
            value:
              _default: "Content-Type, Accept-Ranges, Content-Range, Content-Encoding"

        secretEnvs:
          - name: AWS_ACCESS_KEY_ID
            secretName:
              _default: "sarex-media-storage-secret"
            secretKey: "login"

          - name: AWS_SECRET_ACCESS_KEY
            secretName:
              _default: "sarex-media-storage-secret"
            secretKey: "password"

          - name: AWS_S3_BUCKET
            secretName:
              _default: "sarex-media-storage-secret"
            secretKey: "bucket"

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