apiVersion: v1 kind: ConfigMap metadata: name: pgpool-config labels: name: pgpool-config data: pgpool.conf: |- listen_addresses = '*' port = 9999 socket_dir = '/var/run/pgpool' pcp_listen_addresses = '*' pcp_port = 9898 pcp_socket_dir = '/var/run/pgpool' backend_hostname0 = 'mypostgres' backend_port0 = 5432 backend_weight0 = 1 backend_flag0 = 'ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER' backend_hostname1 = 'mypostgres-replica' backend_port1 = 5432 backend_weight1 = 1 backend_flag1 = 'DISALLOW_TO_FAILOVER' sr_check_period = 0 health_check_period = 0 backend_clustering_mode = 'streaming_replication' num_init_children = 32 max_pool = 4 child_life_time = 300 child_max_connections = 0 connection_life_time = 0 client_idle_limit = 0 connection_cache = on load_balance_mode = on ssl = on enable_pool_hba = on failover_on_backend_error = off log_min_messages = warning # If pool_hba.conf isn't configured, Pgpool-II will automatically generate it. # Note that to use pool_hba.conf you must set enable_pool_hba = on. #pool_hba.conf: |- # local all all trust # hostssl all all 0.0.0.0/0 scram-sha-256