diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 05c02b15de44f..d884b28402000 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -177,3 +177,16 @@ Deprecated value coder.tls.secretName must not be used. {{ fail "coder.tls.secretName is deprecated, use coder.tls.secretNames instead." }} {{- end }} {{- end }} + +{{/* +Renders a value that contains a template. +Usage: +{{ include "coder.renderTemplate" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "coder.renderTemplate" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/helm/templates/extra-templates.yaml b/helm/templates/extra-templates.yaml new file mode 100644 index 0000000000000..e04765810055a --- /dev/null +++ b/helm/templates/extra-templates.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraTemplates }} +--- +{{ include "coder.renderTemplate" (dict "value" . "context" $) }} +{{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index b6ef1aa1a125e..45bfad2558aa5 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -198,3 +198,15 @@ coder: # coder.ingress.tls.wildcardSecretName -- The name of the TLS secret to # use for the wildcard host. wildcardSecretName: "" + +# extraTemplates -- Array of extra objects to deploy with the release. Strings +# are evaluated as a template and can use template expansions and functions. All +# other objects are used as yaml. +extraTemplates: + #- | + # apiVersion: v1 + # kind: ConfigMap + # metadata: + # name: my-configmap + # data: + # key: {{ .Values.myCustomValue | quote }}