Skip to content

Allow overriding external database name in Nominatim chart#141

Merged
robjuz merged 3 commits into
robjuz:masterfrom
frascu:master
Sep 25, 2025
Merged

Allow overriding external database name in Nominatim chart#141
robjuz merged 3 commits into
robjuz:masterfrom
frascu:master

Conversation

@frascu

@frascu frascu commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

This PR allows specifying a custom name for an external database in the Nominatim Helm chart.

Main changes:

  1. _helpers.tpl
    • Updated the nominatim.databaseName function to return:
    • "nominatim" if internal PostgreSQL is enabled (.Values.postgresql.enabled = true)
    • The value of .Values.externalDatabase.databaseName if using an external database (.Values.postgresql.enabled = false)
  2. values.yaml
    • Added externalDatabase.databaseName parameter to configure the external database name:
       ## @param externalDatabase.databaseName External Database name
       ##
       databaseName: nominatim

Benefits:

  • Enables customizing the name of an external database without changing other chart configurations.
  • Improves flexibility for deployments using pre-existing external databases.

@robjuz

robjuz commented Sep 25, 2025

Copy link
Copy Markdown
Owner

@frascu Thax for the PR

Are you sure this will work? Nominatim was always expecting that the database is nominatim

@frascu

frascu commented Sep 25, 2025

Copy link
Copy Markdown
Contributor Author

It works because the connection is defined via the NOMINATIM_DATABASE_DSN environment variable, which is generated as follows:

{{- define "nominatim.databaseDSN" -}}
pgsql:dbname={{ include "nominatim.databaseName" . }};host={{ include "nominatim.databaseHost" . }};port={{ include "nominatim.databasePort" . }};user={{ include "nominatim.databaseUser" . }};password={{ include "nominatim.databasePassword" . }}
{{- end }}

As you can see, the database name is included in the DSN and therefore correctly used by Nominatim.

I tested this setup on the same Kubernetes cluster with the same PostgreSQL instance, using multiple databases with different names, and it worked as expected.

@robjuz robjuz self-requested a review September 25, 2025 14:40
@robjuz robjuz merged commit 296f6dc into robjuz:master Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants