Re: Grafana unable to connect Azure Postgresql Flexible server

From: Prabir Kr Sarkar <prabir(dot)kr(dot)sarkar(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Grafana unable to connect Azure Postgresql Flexible server
Date: 2021-09-07 08:53:59
Message-ID: CADjSiz44rgVe5c+=qkzy_bxS_ZVfeFO7ohHeeQ+eZU2UymOMNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Julien,
Thanks for your response. The url -
https://docs.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-networking
says the following :

- Because Azure Database for PostgreSQL is a managed database service,
users are not provided host or OS access to view or modify configuration
files such as pg_hba.conf. The content of the files is automatically
updated based on the network settings.

- Applications that are deployed on different subnets within the same
virtual network can access flexible servers directly.

So, since our AKS and Postgresql flexible servers *are in the same VNet*
the above assertion holds. Have attached a snapshot of the Networking tab
of postgresql server which says the same thing.

Regards
Prabir Sarkar

On Tue, Sep 7, 2021 at 1:51 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> On Tue, Sep 7, 2021 at 4:14 PM Prabir Kr Sarkar
> <prabir(dot)kr(dot)sarkar(at)gmail(dot)com> wrote:
> >
> > The grafana pod fails to start with the following error:
> >
> > t=2021-09-07T06:40:00+0000 lvl=info msg="Connecting to DB"
> logger=sqlstore dbtype=postgres
> > t=2021-09-07T06:40:00+0000 lvl=info msg="Starting DB migrations"
> logger=migrator
> > service init failed: failed to check table existence: pq: no pg_hba.conf
> entry for host "10.240.1.45", user "grafana", database "grafana", SSL off
>
> That seems quite self explanatory. Your grafana is trying to connect
> as "grafana" role, on "grafana" database from 10.240.1.45, and your
> pg_hba.conf file doesn't allow it. I'm not sure how to configure that
> on AKS but you need to either authorize it or configure grafana to use
> some other credentials that are already allowed, like this one:
>
> > Note: - We can however, connect to the postgresql flexible server from a
> pod (with psql) in the same AKS.
>
> (assuming that this psql connection is allowing other IP). See
> https://www.postgresql.org/docs/current/auth-pg-hba-conf.html for more
> details about the pg_hba.conf file.
>

--
*Thanks and Regards*
*Prabir Sarkar*

Attachment Content-Type Size
Screenshot from 2021-09-07 14-20-59.png image/png 173.3 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Magnus Hagander 2021-09-07 09:08:59 Re: Grafana unable to connect Azure Postgresql Flexible server
Previous Message Julien Rouhaud 2021-09-07 08:21:14 Re: Grafana unable to connect Azure Postgresql Flexible server