diff --git a/charts/planka/templates/deployment.yaml b/charts/planka/templates/deployment.yaml index 2ffe596f..31ab2e1c 100644 --- a/charts/planka/templates/deployment.yaml +++ b/charts/planka/templates/deployment.yaml @@ -64,8 +64,16 @@ spec: {{- toYaml .Values.resources | nindent 12 }} env: {{- if not .Values.postgresql.enabled }} + {{- if .Values.existingDburlSecret }} - name: DATABASE_URL - value: {{ required "If the included postgresql deployment is disabled you need to define a Database URL in 'dburl'" .Values.dburl }} + valueFrom: + secretKeyRef: + name: .Values.existingDburlSecret + key: uri + {{- else }} + - name: DATABASE_URL + value: {{ required "If the included postgresql deployment is disabled you need to provide an existing secret in .Values.existingDburlSecret or define a Database URL in 'dburl'" .Values.dburl }} + {{- end }} {{- else }} - name: DATABASE_URL valueFrom: diff --git a/charts/planka/values.yaml b/charts/planka/values.yaml index 8adf94f6..a6bc393c 100644 --- a/charts/planka/values.yaml +++ b/charts/planka/values.yaml @@ -105,9 +105,15 @@ postgresql: serviceBindings: enabled: true -## Set this if you disable the built-in postgresql deployment +## Set this or existingDburlSecret if you disable the built-in postgresql deployment dburl: +## @param existingDburlSecret Name of an existing secret containing a DBurl connection string +## NOTE: Must contain key `uri` +## NOTE: When it's set, the `dburl` parameter is ignored +## +existingDburlSecret: "" + ## PVC-based data storage configuration persistence: enabled: false