Skip to content

Commit

Permalink
Merge pull request #51 from brunobriante/main
Browse files Browse the repository at this point in the history
Add option to customize databaseUrlSecretName key
  • Loading branch information
rubenfiszel authored Jan 2, 2024
2 parents 646097c + 5b718bc commit a632f1f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/windmill/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
4 changes: 2 additions & 2 deletions charts/windmill/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.windmill.appReplicas }}
strategy:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 3
Expand Down Expand Up @@ -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 }}"
Expand Down
6 changes: 3 additions & 3 deletions charts/windmill/templates/worker-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
workerGroup: {{ $v.name }}
spec:
replicas: {{ $v.replicas }}
strategy:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 3
Expand Down Expand Up @@ -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 }}"
Expand Down Expand Up @@ -153,6 +153,6 @@ spec:
{{- with $v.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/windmill/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a632f1f

Please sign in to comment.