---
bases:
  - envs/common.yaml
---
releases:

#######################################################################################
## postgresql                                                                        ##
## PostgreSQL is a powerful, open source object-relational database system           ##
#######################################################################################

#
# References:
#   - https://github.com/bitnami/charts/tree/master/bitnami/postgresql
#   - https://www.postgresql.org/
#
- name: "postgresql-keycloak"
  namespace: "security"
  labels:
    chart: "postgresql"
    repo: "bitnami"
    component: "sso"
    namespace: "security"
    vendor: "bitnami"
    default: "false"
  chart: "bitnami/postgresql"
  {{- if eq .Values.global.platform "openshift" }}
  hooks:
  - events: ["prepare"]
    showlogs: true
    command: "kubectl"
    args: ["apply", "-f", "../resources/postgresql-keycloak-scc.yaml"]
  - events: ["postuninstall"]
    showlogs: true
    command: "kubectl"
    args: ["delete", "-f", "../resources/postgresql-keycloak-scc.yaml"]
  {{- end }}
  version: "12.1.15"
  wait: true
  installed: true
  values:
  - readReplicas:
      # Number of PostgreSQL read only replicas
      replicaCount: 1

    image:
      tag: 15.2.0-debian-11-r0

    global:
      postgresql:
        auth:
          username: admin
          existingSecret: keycloak-postgresql
          database: keycloak

    primary:
      persistence:
        enabled: true
        size: 3Gi
