Skip to content

Commit

Permalink
Add support for "existing secrets" (#41)
Browse files Browse the repository at this point in the history
* Add support for "existing secrets"

* Clarify use of existingSecret
  • Loading branch information
gmemstr committed Jun 29, 2023
1 parent 675f7a4 commit 33dd27c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ config: # Dict with all n8n config options
# postgresdb:
# database: n8n
# host: localhost
#
# existingSecret and secret are exclusive, with existingSecret taking priority.
# existingSecret: "" # Use an existing Kubernetes secret, e.g created by hand or Vault operator.
secret: # Dict with all n8n config options, unlike config the values here will end up in a secret.
# database:
# postgresdb:
Expand Down
6 changes: 3 additions & 3 deletions templates/deployment.webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ spec:
configMap:
name: {{ include "n8n.fullname" . }}
{{- end }}
{{- if .Values.secret }}
{{- if or (.Values.secret) (.Values.existingSecret) }}
- name: secret-volume
secret:
secretName: {{ include "n8n.fullname" . }}
secretName: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{ else }}{{ include "n8n.fullname" . }}{{ end }}
items:
- key: "secret.json"
path: "secret.json"
{{- end }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions templates/deployment.worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ spec:
configMap:
name: {{ include "n8n.fullname" . }}
{{- end }}
{{- if .Values.secret }}
{{- if or (.Values.secret) (.Values.existingSecret) }}
- name: secret-volume
secret:
secretName: {{ include "n8n.fullname" . }}
secretName: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{ else }}{{ include "n8n.fullname" . }}{{ end }}
items:
- key: "secret.json"
path: "secret.json"
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ spec:
configMap:
name: {{ include "n8n.fullname" . }}
{{- end }}
{{- if .Values.secret }}
{{- if or (.Values.secret) (.Values.existingSecret) }}
- name: secret-volume
secret:
secretName: {{ include "n8n.fullname" . }}
secretName: {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{ else }}{{ include "n8n.fullname" . }}{{ end }}
items:
- key: "secret.json"
path: "secret.json"
Expand Down
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ config:
pruneData: "true" # prune executions by default
pruneDataMaxAge: 3760 # Per defaut we store 1 year of history


# existingSecret and secret are exclusive, with existingSecret taking priority.
# existingSecret: "" # Use an existing Kubernetes secret, e.g created by hand or Vault operator.
secret: # Dict with all n8n json config options, unlike config the values here will end up in a secret.

# Typical Example of a config in combination with a secret.
Expand Down

0 comments on commit 33dd27c

Please sign in to comment.