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?

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?