apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: zitadel
  namespace: zitadel
spec:
  interval: 5m
  timeout: 10m
  dependsOn:
    - name: postgresql
      namespace: postgresql
  values:
    postgresqlSecret:
      create: false
      vault:
        enabled: true
        role: zitadel
        authPath: auth/kubernetes
        secretPath: secrets/data/zitadel/postgresql
        secretKey: password
    zitadel:
      configmapConfig:
        ExternalDomain: zitadel.contour.infra.sarex.tech
    login:
      env:
        - name: ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED
          value: "false"
        - name: ZITADEL_DATABASE_POSTGRES_HOST
          value: "postgresql.postgresql.svc.cluster.local"
        - name: ZITADEL_DATABASE_POSTGRES_PORT
          value: "5432"
    env:
      - name: ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED
        value: "false"
      - name: ZITADEL_DATABASE_POSTGRES_HOST
        value: "postgresql.postgresql.svc.cluster.local"
      - name: ZITADEL_DATABASE_POSTGRES_PORT
        value: "5432"
      - name: DUMB_FUCK
        value: "ass"  
