apiVersion: v1
kind: ConfigMap
metadata:
  name: common-env
data:
  POSTGRES_HOST: init0-postgresql-ha-pgpool
  POSTGRES_HOST_RO: init0-postgresql-ha-pgpool
  POSTGRES_HOST_RW: init0-postgresql-ha-pgpool
  POSTGRES_PORT: "5432"
  POSTGRES_DB: cdbs
  POSTGRES_USER: postgres
  POSTGREST_USER_RO:  postgrest_ro
  chisel-auth-file: |
    {
      "rcmorano:CHANGEME": [""]
    }
  fixme.sql: |
    CREATE DATABASE cdbs;
    CREATE ROLE postgrest_ro;
    GRANT CONNECT ON DATABASE cdbs TO postgrest_ro;
    GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgrest_ro;
    GRANT USAGE ON SCHEMA public TO postgrest_ro;
    ALTER ROLE postgrest_ro WITH login;
    ALTER USER postgrest_ro WITH PASSWORD 'CHANGEME';
    GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA PUBLIC TO postgrest_ro;
