repositories:
- name: bitnami
  url: registry-1.docker.io/bitnamicharts
  oci: true

releases:
  - name: keycloak
    installed: {{ eq .Environment.Name "dev" | toYaml }}
    missingFileHandler: Warn
    namespace: {{ .Namespace }}
    chart: bitnami/keycloak
    version: 17.3.6
    values:
      - postgresql:
          auth:
            username: keycloak
            password: keycloak
            database: keycloak
      - extraEnvVars:
          - name: KEYCLOAK_EXTRA_ARGS
            value: "--import-realm"
          - name: KC_HOSTNAME_URL
            value: https://keycloak.127.0.0.1.nip.io
      - extraVolumes:
          - name: import
            configMap:
              name: docs-keycloak
      - extraVolumeMounts:
          - name: import
            mountPath: /opt/bitnami/keycloak/data/import/
      - auth:
          adminUser: su
          adminPassword: su
      - proxy: edge
      - ingress:
          enabled: true
          hostname: keycloak.127.0.0.1.nip.io
      - extraDeploy:
        - apiVersion: v1
          kind: ConfigMap
          metadata:
            name: docs-keycloak
          data:
            impress.json: |
{{ readFile "../../docker/auth/realm.json" | replace "http://localhost:3200" "https://impress.127.0.0.1.nip.io" | indent 14 }}

  - name: postgres
    installed: {{ eq .Environment.Name "dev" | toYaml }}
    namespace: {{ .Namespace }}
    chart: bitnami/postgresql
    version: 13.1.5
    values:
      - auth:
          username: dinum
          password: pass
          database: impress
      - tls:
          enabled: true
          autoGenerated: true

  - name: minio
    installed: {{ eq .Environment.Name "dev" | toYaml }}
    namespace: {{ .Namespace }}
    chart: bitnami/minio
    version: 12.10.10
    values: 
      - auth:
          rootUser: root
          rootPassword: password
      - provisioning:
          enabled: true
          buckets:
            - name: impress-media-storage
              versioning: true

  - name: redis
    installed: {{ eq .Environment.Name "dev" | toYaml }}
    namespace: {{ .Namespace }}
    chart: bitnami/redis
    version: 20.6.2
    values:
      - auth:
          password: pass
        architecture: standalone

  - name: impress
    version: {{ .Values.version }}
    namespace: {{ .Namespace }}
    chart: ./impress
    values:
      - env.d/{{ .Environment.Name }}/values.impress.yaml.gotmpl

environments:
  dev:
    values:
      - version: 2.0.1
