Skip to content

Commit

Permalink
feat(helm): wait for database settings
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <[email protected]>
  • Loading branch information
nlamirault committed Dec 11, 2024
1 parent 1ed19cd commit a23df3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/keep/templates/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ spec:
resources:
{{- toYaml .Values.backend.resources | nindent 12 }}
initContainers:
{{- if .Values.backend.waitForDatabase }}
{{- if .Values.backend.waitForDatabase.enabled }}
- name: wait-for-database
image: busybox
command: ['sh', '-c', 'until nc -z {{ include "keep.findEnvVar" (list "DATABASE_NAME" .) | default "keep-database" }} 3306; do sleep 1; done;']
command: ['sh', '-c', 'until nc -z {{ include "keep.findEnvVar" (list "DATABASE_NAME" .) | default "keep-database" }} {{ .Values.backend.waitForDatabase.port }}; do sleep 1; done;']
{{- end }}
{{- range .Values.backend.extraInitContainers }}
- name: {{ .name }}
Expand Down
4 changes: 3 additions & 1 deletion charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ backend:
enabled: true
# if true, wait for the database to be ready before starting the API
# if you use external database, you can set this to false
waitForDatabase: true
waitForDatabase:
enabled: true
port: 3306
# if true, the database connection string will be read from a secret
# if it is false, the DATABASE_CONNECTION_STRING value can be set directly
databaseConnectionStringFromSecret:
Expand Down

0 comments on commit a23df3d

Please sign in to comment.