apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: keycloak
  namespace: keycloak
spec:
  interval: 5m
  timeout: 15m
  dependsOn:
    - name: postgresql
      namespace: postgresql
  values:
    global:
      defaultStorageClass: local-path
      imageRegistry: ""
    persistence:
      enabled: true
      storageClass: local-path
      size: 10Gi
    postgresql:
      enabled: false
    vaultEnv:
      enabled: true
      role: keycloak
      authPath: auth/kubernetes
      envFiles:
        KEYCLOAK_ADMIN_PASSWORD:
          path: secrets/data/keycloak/admin
          key: password
        KEYCLOAK_PASSWORD:
          path: secrets/data/keycloak/admin
          key: password
        KEYCLOAK_DATABASE_HOST:
          path: secrets/data/keycloak/postgresql
          key: host
        KEYCLOAK_DATABASE_PORT:
          path: secrets/data/keycloak/postgresql
          key: port
        KEYCLOAK_DATABASE_USER:
          path: secrets/data/keycloak/postgresql
          key: user
        KEYCLOAK_DATABASE_NAME:
          path: secrets/data/keycloak/postgresql
          key: database
        KEYCLOAK_DATABASE_PASSWORD:
          path: secrets/data/keycloak/postgresql
          key: password
    externalDatabase:
      host: "postgresql.postgresql.svc.cluster.local"
      port: 5432
      user: keycloak
      database: keycloak
