---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: attachments
  namespace: attachments
spec:
  values:
    services:
      attachments:
        podAnnotations:
          _default:
            vault.hashicorp.com/auth-path: auth/kubernetes
            vault.hashicorp.com/role: attachments-vault
            vault.hashicorp.com/agent-inject-secret-attachments-db: secrets/data/postgresql/apps/attachments
            vault.hashicorp.com/agent-inject-template-attachments-db: |-
              {{- with secret "secrets/data/postgresql/apps/attachments" -}}
              DATABASE_HOST={{ index .Data.data "host" }}
              DATABASE_PORT={{ index .Data.data "port" }}
              DATABASE_NAME={{ index .Data.data "database" }}
              DATABASE_USER={{ index .Data.data "username" }}
              DATABASE_PASSWORD={{ index .Data.data "password" }}
              DATABASE_SSL_MODE=disable
              {{- end -}}
#            vault.hashicorp.com/agent-inject-secret-attachments-s3: secrets/data/minio/apps/attachments
#            vault.hashicorp.com/agent-inject-template-attachments-s3: |-
#              {{- with secret "secrets/data/minio/apps/attachments" -}}
#              YANDEX_S3_ENDPOINT_URL=minio.minio:9000
#              YANDEX_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }}
#              YANDEX_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }}
#              YANDEX_S3_USE_SSL=false
#              YANDEX_S3_REGION=ru-central
#              YANDEX_S3_VERIFY=false
#              BUCKET_NAME=attachments
#              {{- end -}}
