From 5b718bcb234418f9bd9f464e3c85b3e3adb26faf Mon Sep 17 00:00:00 2001 From: Bruno Briante Date: Sun, 31 Dec 2023 13:46:52 -0300 Subject: [PATCH] add option for database connection secret key name --- charts/windmill/README.md.gotmpl | 2 +- charts/windmill/templates/app.yaml | 4 ++-- charts/windmill/templates/worker-groups.yaml | 6 +++--- charts/windmill/values.yaml | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/charts/windmill/README.md.gotmpl b/charts/windmill/README.md.gotmpl index 1869f39..f292e50 100644 --- a/charts/windmill/README.md.gotmpl +++ b/charts/windmill/README.md.gotmpl @@ -19,7 +19,7 @@ If you would prefer to keep the PostgreSQL password or connection string out of the Helm values, there are two different possible approaches: -1. Use `windmill.databaseUrlSecretName` to point at a Secret with a `url` key containing the entire database connection string. +1. Use `windmill.databaseUrlSecretName` to point at a Secret with a `url` key or another key set with `windmill.databaseUrlSecretKey` that contains the entire database connection string. 2. Use `windmill.databaseUrl` with [Dependent Environment Variables](https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/) together with `windmill.app.extraEnv` and `windmill.workers.extraEnv`. diff --git a/charts/windmill/templates/app.yaml b/charts/windmill/templates/app.yaml index 40d8fc0..3e4ab68 100644 --- a/charts/windmill/templates/app.yaml +++ b/charts/windmill/templates/app.yaml @@ -10,7 +10,7 @@ metadata: heritage: {{ .Release.Service }} spec: replicas: {{ .Values.windmill.appReplicas }} - strategy: + strategy: type: RollingUpdate rollingUpdate: maxSurge: 3 @@ -76,7 +76,7 @@ spec: valueFrom: secretKeyRef: name: "{{ .Values.windmill.databaseUrlSecretName }}" - key: url + key: "{{ .Values.windmill.databaseUrlSecretKey }}" {{ else }} - name: "DATABASE_URL" value: "{{ .Values.windmill.databaseUrl }}" diff --git a/charts/windmill/templates/worker-groups.yaml b/charts/windmill/templates/worker-groups.yaml index 5b2a9b8..cbb3036 100644 --- a/charts/windmill/templates/worker-groups.yaml +++ b/charts/windmill/templates/worker-groups.yaml @@ -14,7 +14,7 @@ metadata: workerGroup: {{ $v.name }} spec: replicas: {{ $v.replicas }} - strategy: + strategy: type: RollingUpdate rollingUpdate: maxSurge: 3 @@ -77,7 +77,7 @@ spec: valueFrom: secretKeyRef: name: "{{ $.Values.windmill.databaseUrlSecretName }}" - key: url + key: "{{ $.Values.windmill.databaseUrlSecretKey }}" {{ else }} - name: "DATABASE_URL" value: "{{ $.Values.windmill.databaseUrl }}" @@ -153,6 +153,6 @@ spec: {{- with $v.tolerations }} tolerations: {{ toYaml . | indent 8 }} -{{- end }} +{{- end }} {{- end }} {{- end }} diff --git a/charts/windmill/values.yaml b/charts/windmill/values.yaml index 369ce89..e0aefe0 100644 --- a/charts/windmill/values.yaml +++ b/charts/windmill/values.yaml @@ -38,8 +38,10 @@ windmill: lspReplicas: 2 # -- replicas for the lsp containers used by the app multiplayerReplicas: 1 - # -- name of the secret storing the database URI, take precedence over databaseUrl. The key of the url is 'url' + # -- name of the secret storing the database URI, take precedence over databaseUrl. databaseUrlSecretName: "" + # -- name of the key in secret storing the database URI. The default key of the url is 'url' + databaseUrlSecretKey: url # -- Postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container databaseUrl: postgres://postgres:windmill@windmill-postgresql/windmill?sslmode=disable # -- domain as shown in browser, this variable and `baseProtocol` are used as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled