diff --git a/kubernetes/entrypoint.sh b/kubernetes/entrypoint.sh index ad7f6263..56dac89e 100755 --- a/kubernetes/entrypoint.sh +++ b/kubernetes/entrypoint.sh @@ -15,6 +15,7 @@ bootstrap: pg_hba: - host all all 0.0.0.0/0 md5 - host replication ${PATRONI_REPLICATION_USERNAME} ${PATRONI_KUBERNETES_POD_IP}/16 md5 + - host replication ${PATRONI_REPLICATION_USERNAME} 127.0.0.1/32 md5 initdb: - auth-host: md5 - auth-local: trust diff --git a/patroni/api.py b/patroni/api.py index 8ead28c3..d0d6af43 100644 --- a/patroni/api.py +++ b/patroni/api.py @@ -655,7 +655,7 @@ class RestApiHandler(BaseHTTPRequestHandler): metrics.append("# HELP patroni_postgres_timeline Postgres timeline of this node (if running), 0 otherwise.") metrics.append("# TYPE patroni_postgres_timeline counter") - metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline', 0))) + metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline') or 0)) metrics.append("# HELP patroni_dcs_last_seen Epoch timestamp when DCS was last contacted successfully" " by Patroni.")