postgres_operator_ui_short_name: "postgres-operator-ui"
postgres_operator_default_values:
  configKubernetes:
    pod_environment_configmap: "{{ postgres_db_namespace | default(namespace) }}/postgresql-pod-environment"
    storage_resize_mode: pvc
    watched_namespace: "{{ postgres_operator_watch_namespace | default(namespace) }}"

postgres_operator_ui_default_values:
  replicaCount: 1
  
  envs:
    # IMPORTANT: While operator chart and UI chart are idendependent, this is the interface between
    # UI and operator API. Insert the service name of the operator API here!
    operatorApiUrl: "http://postgres-operator:8080"
    operatorClusterNameLabel: "cluster-name"
    resourcesVisible: "False"
    targetNamespace: "{{ namespace }}"
  
  # configure UI ingress. If needed: "enabled: true"
  ingress:
    enabled: true
    annotations:
      cert-manager.io/cluster-issuer: "letsencrypt-prod"
      kubernetes.io/ingress.class: "{{ postgres_operator_ui_ingress_class | default(internal_ingress_class) }}"
    hosts:
      - host: "{{ postgres_operator_ui_short_name }}.{{ domain }}"
        paths: [""]
    tls: 
      - secretName: "{{ postgres_operator_ui_short_name }}.{{ domain }}-tls"
        hosts:
          - "{{ postgres_operator_ui_short_name }}.{{ domain }}"


postgres_db_definitions:
  ghp-postgres: |
    kind: "postgresql"
    apiVersion: "acid.zalan.do/v1"
    metadata:
      name: "{{ postgres_db_team | default(namespace) }}-postgres"
      namespace: "{{ postgres_db_namespace | default(namespace) }}"
      labels:
        team: "{{ postgres_db_team | default(namespace) }}"
    spec:
      teamId: "{{ postgres_db_team | default(namespace) }}"
      postgresql:
        version: "12"
      numberOfInstances: 2
      volume:
        size: "{{ postgres_size | default('10Gi') }}"
      users:
        gitea: []
        drone: []
        bitwarden: []
        wikijs: []
        nextcloud: []
        roundcube: []
        harbor: []
        mastodon: []
      databases:
        gitea: gitea
        drone: drone
        bitwarden: bitwarden
        wikijs: wikijs
        nextcloud: nextcloud
        roundcube: roundcube
        harbor_registry: harbor
        harbor_clair: harbor
        harbor_notary_server: harbor
        harbor_notary_signer: harbor
        mastodon: mastodon
      preparedDatabases:
        peertube:
          defaultUsers: true
          extensions:
            pg_trgm: pg_catalog
            unaccent: public
      allowedSourceRanges: []
      resources:
        requests:
          cpu: 100m
          memory: 100Mi
        limits:
          cpu: 500m
          memory: 500Mi