CrunchyData / crunchy-containers

Containers for Managing PostgreSQL on Kubernetes by Crunchy Data
https://www.crunchydata.com/
Apache License 2.0
1.01k stars 328 forks source link

pgbackrest_info.sh should be part of the base postgresql container #1376

Closed schewara closed 3 years ago

schewara commented 3 years ago

Setting up Monitoring for a standalone postgres container fails, as the cruncy-postgres-exporter requires a shell script which is only available as part of the postgres-ha container image.

The log from postgres_exporter.go:1356: shows the following error

"Error running query on database \"mydb:5432\": ccp_backrest_oldest_full_backup pq: program \"/opt/crunchy/bin/postgres-ha/pgbackrest/pgbackrest_info.sh 6991185832398311480\" failed"

To Reproduce Steps to reproduce the behavior:

  1. start the postgres container with the following Variables set
    • PGBACKREST=true
    • PGMONITOR_PASSWORD=xyz
  2. start the postgres-exporter conainer with
    • EXPORTER_PG_PASSWORD=xyz
    • EXPORTER_PG_HOST=mydb
    • EXPORTER_PG_PARAMS=sslmode=disable
  3. access the metrics endpoint
  4. ccp_backrest_xxx metrics are missing and the errors above shown in the exporter logs

Expected behavior Enabling pgbackrest and monitoring in the container should have all dependencies included and not throw errors

Container Versions