Configure Chirpstack with external postgres DBs in K8s

Hi

I am trying to deploy chirpstack in k8s by pointing to external Postgres DB for the app and network server.

I was able to deploy using container-based Postgres DB where we run 4 init scripts to create roles like chirpstack_as and chirpstack_ns.

Instead of the above, I am trying to use external DB for app and network server. So I have created appserverDB and networkserverDB and then created role like chirpstack_as inside appserverDB and chirpstack_ns inside networkserverDB now I am trying to log in like

psql -h db-hostname -d appserverDB -U chirpstack_as
but its giving me below error

psql: error: FATAL: LDAP authentication failed for user ā€œchirpstack_asā€
FATAL: LDAP authentication failed for user ā€œchirpstack_asā€

same here i am getting after deploying chirpstack to k8s as well

Note: My user is different itā€™s not the same as the role we required.

Thanks
Ashish

@brocaar Do you have any suggestion on this?

1 Like

In therms of ChirpStack configuration, just change the PostgreSQL dns with the correct parameters (e.g. the external hostname it should connect to).

This is not much different from the Docker example, where each server uses a different hostname:

In this case the PostgreSQL server is reachable using the postgresql hostname.

However, I canā€™t help you solving authentication failed for user ā€œchirpstack_asā€ issues. I donā€™t think that is related to ChirpStack in any way.

2 Likes

Thanks, @brocaar for your quick response on this.
Few quick follow up questions on this

  1. For example for the app server, If my external DB is appServerDB instead of chirpstack_as(as mentioned in initdb scripts) do we still need to create the role as ā€˜chirpstack_asā€™?

  2. We have to create a database and role as ā€˜chirpstack_asā€™, Does this required to be like this with the name or we can have both with any name?

  3. Inside both DB does schema have to be ā€˜publicā€™ or we can have a different schema if yes then where we can specify this?

for the schema you can add it to the dsn with ?search_path=MY_SCHEMA
You need to change the dsn, you seem to have changed names and users, so the dsn should also reflect this.

Thanks, @chopmann I will give it a try by adding my schema name in DSN instead of using public default.
For Role, Do we need need to have role as ā€œchirpstack_asā€ if my user and DB name and schema name is different?