diff --git a/helm/wekan/Chart.yaml b/helm/wekan/Chart.yaml index 355f5bf24..b7b508278 100644 --- a/helm/wekan/Chart.yaml +++ b/helm/wekan/Chart.yaml @@ -1,5 +1,5 @@ name: wekan -version: 1.0.2 +version: 1.0.3 apiVersion: v1 description: Open Source kanban home: https://wekan.github.io/ diff --git a/helm/wekan/templates/_helpers.tpl b/helm/wekan/templates/_helpers.tpl index fab37c9d9..5ee1b10e9 100644 --- a/helm/wekan/templates/_helpers.tpl +++ b/helm/wekan/templates/_helpers.tpl @@ -81,7 +81,7 @@ else use user-provided URL. {{- $release := .Release.Name -}} {{- $replicaSetName := (index .Values "mongodb" "replicaSetName") -}} {{- $mongodbSvcName := include "wekan.mongodb.svcname" . -}} -mongodb://{{- range $v := until $count }}{{ $release }}-mongodb-{{ $v }}.{{ $mongodbSvcName }}:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}?replicaSet={{ $replicaSetName }} +mongodb://{{- range $v := until $count }}{{ $release }}-mongodb-{{ $v }}.{{ $mongodbSvcName }}:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}/{{ .Values.dbname }}?replicaSet={{ $replicaSetName }} {{- else -}} {{- index .Values "mongodb" "url" -}} {{- end -}} diff --git a/helm/wekan/templates/deployment.yaml b/helm/wekan/templates/deployment.yaml index 89b75aa15..c7f192f1e 100644 --- a/helm/wekan/templates/deployment.yaml +++ b/helm/wekan/templates/deployment.yaml @@ -46,7 +46,10 @@ spec: {{- range $key := .Values.secretEnv }} {{- if .value }} - name: {{ .name }} - value: {{ .value | quote }} + valueFrom: + secretKeyRef: + name: {{ template "wekan.fullname" $ }}-secret + key: {{ .name }} {{- end }} {{- end }} livenessProbe: diff --git a/helm/wekan/templates/secret.yaml b/helm/wekan/templates/secret.yaml new file mode 100644 index 000000000..3674692cd --- /dev/null +++ b/helm/wekan/templates/secret.yaml @@ -0,0 +1,11 @@ +{{ if .Values.secretEnv }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "wekan.fullname" $ }}-secret +type: Opaque +data: + {{- range $key := .Values.secretEnv }} + {{ $key.name }}: {{ $key.value | b64enc }} + {{- end}} +{{ end }} diff --git a/helm/wekan/values.yaml b/helm/wekan/values.yaml index 24e5413cb..280289187 100644 --- a/helm/wekan/values.yaml +++ b/helm/wekan/values.yaml @@ -21,6 +21,7 @@ image: ## replicaCount: 1 +dbname: wekan ## Specify additional environmental variables for the Deployment ## @@ -32,9 +33,9 @@ env: ## Deployment. These can e.g. be provided by a Secret and allow ## to store passwords separately ## -secretEnv: - - name: "" - value: "" +secretEnv: {} + # - name: "" + # value: "" service: type: NodePort