Can we connect percona with GCP cloud SQL (postgres) where sslmode= verify-ca?

can we connect postgres with percona using certificates and Keys?

DATA_SOURCE_NAME=“postgresql://postgres_exporter:postgres123@10.49.208.198:5432/postgres?sslmode=verify-ca&sslrootcert=/etc/ssl/certs/server-ca.pem&sslcert=/etc/ssl/certs/client-cert.pem&sslkey=/etc/ssl/certs/client-key.pem”

Hello!

Thank you for your question!

The current version of PMM natively does not support SSL certificates for PostgreSQL. But we received your request in JIRA and now considering when we can implement and deliver this feature.

For now, I can only suggest trying the next workaround.

  1. Start postgres_exporter separately from PMM.

    [root@3e6f8f3a4b17 exporters]# export DATA_SOURCE_NAME=‘postgresql://postgres:secret@12.12.12.12:5432/postgres?sslmode=verify-ca&sslrootcert=server-ca.pem&sslcert=client-cert.pem&sslkey=client-key.pem’

    [root@3e6f8f3a4b17 exporters]# ./postgres_exporter
    INFO[0000] Starting postgres_exporter (version=, branch=, revision=) source=“postgres_exporter.go:1687”
    INFO[0000] Build context (go=go1.15.7, user=, date=) source=“postgres_exporter.go:1688”
    INFO[0000] Established new database connection to “12.12.12.12:5432”. source=“postgres_exporter.go:894”
    INFO[0001] Semantic Version Changed on “12.12.12.12:5432”: 0.0.0 → 13.2.0 source=“postgres_exporter.go:1437”
    INFO[0003] Starting HTTP server for http://:9187/metrics … source=“server.go:144”

  2. Add it to PMM as an external exporter.

    [root@3e6f8f3a4b17 /]# pmm-admin add external --listen-port=9187 --service-name=“gcp-postresql-external”
    External Service added.
    Service ID : /service_id/b2913b7d-2533-4c2e-80db-dec276d7da0c
    Service name: gcp-postresql-external
    Group : external

  3. See metrics on the dashboard.

Best regards!

1 Like