relating with telegraf doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PostgreSQL Charm |
Triaged
|
High
|
Unassigned |
Bug Description
Ubuntu 20.04, charm version 206.
Relating postgresql:db-admin with telegraf:postgresql doesn't work.
There's a mistmatch between the connstr and the pg_hba entry.
$ juju run --unit telegraf/0 "relation-get -r postgresql:10 - postgresql/2"
allowed-subnets: 10.2.3.4/32
egress-subnets: 10.2.3.4/32
host: 127.0.1.1
master: dbname=telegraf host=127.0.1.1 password=<REDACTED> port=5432 user=jujuadmin_
[...]
^ postgresql gives 127.0.1.1 in the relation
postgresql/0 $ sudo grep telegraf /etc/postgresql
host all all "10.2.3.4/32" md5 # db-admin:10 (telegraf/0)
^ but in the pg_hba file, it uses the actual IP
leading to the constant logging of the following on the unit :
2020-08-
The charm should add the same IP it sends in the connstr to pg_hba.conf
Thanks
pg_hba.conf should contain the egress addresses of the clients, taken from the relation. It is quite possible that subordinates do not supply this information (since they are cohosted), and the PostgreSQL charm needs to cope with that.