Skip to content

Commit

Permalink
close #90
Browse files Browse the repository at this point in the history
  • Loading branch information
robjuz committed Nov 21, 2024
1 parent e6fd0a0 commit 7e81361
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/nominatim/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 4.2.3
version: 4.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/nominatim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ kind: Secret
metadata:
name: my-secret
data:
POSTGRESQL_DSN: pgsql:host=release-name-postgresql;port=5432;user=postgres;password=nominatim;dbname=nominatim
POSTGRESQL_DSN: postgresql://user:password@host:port/database
```

### Ingress
Expand Down
2 changes: 1 addition & 1 deletion charts/nominatim/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Add environment variables to configure database values
Create the database URL.
*/}}
{{- define "nominatim.databaseUrl" -}}
pgsql:host={{ include "nominatim.databaseHost" . }};port={{ include "nominatim.databasePort" . }};user={{ include "nominatim.databaseUser" . }};password={{ include "nominatim.databasePassword" . }};dbname={{ include "nominatim.databaseName" . }}
postgresql://{{ include "nominatim.databaseUser" . }}:{{ include "nominatim.databasePassword" . }}@{{ include "nominatim.databaseHost" . }}:{{ include "nominatim.databasePort" . }}/{{ include "nominatim.databaseName" . }}
{{- end }}

{{- define "nominatim.containerPort" -}}
Expand Down
3 changes: 1 addition & 2 deletions charts/nominatim/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ spec:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecretDsn }}
key: {{ .Values.externalDatabase.existingSecretDsnKey }}
{{- end }}
{{- if not .Values.externalDatabase.existingSecretDsn }}
{{- else }}
value: {{ include "nominatim.databaseUrl" . }}
{{- end }}
{{- if .Values.extraEnvVars }}
Expand Down
27 changes: 20 additions & 7 deletions charts/nominatim/templates/initJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,26 @@ spec:
{{- end }}
initContainers:
- name: wait-for-db
image: chainguard/wait-for-it:latest
image: postgres
env:
- name: NOMINATIM_DATABASE_DSN
{{- if .Values.externalDatabase.existingSecretDsn }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecretDsn }}
key: {{ .Values.externalDatabase.existingSecretDsnKey }}
{{- else }}
value: {{ include "nominatim.databaseUrl" . }}
{{- end }}
args:
- -h
- {{ include "nominatim.databaseHost" . | quote}}
- -p
- {{ include "nominatim.databasePort" . | quote }}
- /bin/bash
- -c
- |
echo $NOMINATIM_DATABASE_DSN;
until pg_isready -d $NOMINATIM_DATABASE_DSN; do
echo "Waiting for database..."
sleep 2
done
- name: download
image: curlimages/curl
Expand Down Expand Up @@ -113,8 +127,7 @@ spec:
secretKeyRef:
name: {{ .Values.externalDatabase.existingSecretDsn }}
key: {{ .Values.externalDatabase.existingSecretDsnKey }}
{{- end }}
{{- if not .Values.externalDatabase.existingSecretDsn }}
{{- else }}
value: {{ include "nominatim.databaseUrl" . }}
{{- end }}
{{- if .Values.flatnode.enabled }}
Expand Down

0 comments on commit 7e81361

Please sign in to comment.