Skip to content

Commit 2087651

Browse files
committed
helm: Add support for mounting config from secret
This change allows for config files to be sourced from a secret rather than a config map as these configs may have sensitive data. In addition to being able to source the config from a secret, the `extraContainerVolumeMounts` option was added which allows for mounting additional volumes defined in `extraContainerVolumes`, such mounting a passkey file secret. This also solves the same issue in a slightly different way from pr matrix-org#962 Signed-off-by: Mike Mason <[email protected]>
1 parent 6690036 commit 2087651

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

helm/hookshot/templates/_pod.tpl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ containers:
4343
{{- toYaml .Values.containerSecurityContext | nindent 6 }}
4444
{{- end }}
4545
volumeMounts:
46-
{{- if or (and (not .Values.hookshot.existingConfigMap) (.Values.hookshot.config)) (.Values.hookshot.existingConfigMap) }}
4746
- name: config
4847
mountPath: "/data"
48+
{{- if .Values.extraContainerVolumeMounts }}
49+
{{ tpl (toYaml .Values.extraContainerVolumeMounts) . | indent 6 }}
4950
{{- end }}
5051
ports:
5152
- name: webhook
@@ -108,9 +109,15 @@ tolerations:
108109
{{ toYaml . | indent 2 }}
109110
{{- end }}
110111
volumes:
112+
{{- if .Values.hookshot.existingConfigSecretName }}
113+
- name: config
114+
secret:
115+
secretName: {{ .Values.hookshot.existingConfigSecretName }}
116+
{{- else }}
111117
- name: config
112118
configMap:
113119
name: {{ template "hookshot.configMapName" . }}
120+
{{- end }}
114121
{{- $root := . }}
115122
{{- range .Values.extraConfigmapMounts }}
116123
- name: {{ tpl .name $root }}

helm/hookshot/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
{{- if not .Values.hookshot.existingConfigMap }}
2+
{{- if not (or .Values.hookshot.existingConfigMap .Values.hookshot.existingConfigSecretName) }}
33
apiVersion: v1
44
kind: ConfigMap
55
metadata:

helm/hookshot/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ tolerations: []
101101
# -- Affinity settings for deployment
102102
affinity: {}
103103
hookshot:
104+
# -- Name of existing config Secret with valid Hookshot configuration
105+
existingConfigSecretName:
104106
# -- Name of existing ConfigMap with valid Hookshot configuration
105107
existingConfigMap:
106108
# -- Raw Hookshot configuration. Gets templated into a YAML file and then loaded unless an existingConfigMap is specified.

0 commit comments

Comments
 (0)