How do you include non-template files such as config files in a chart?
IntermediateConceptChart Structure & Metadata
Answer
Place them anywhere in the chart outside templates/ (for example files/ or config/) and read them with .Files:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "shop.fullname" . }}-nginx
data:
nginx.conf: |-
{{ .Files.Get "files/nginx.conf" | indent 4 }}
.Files cannot read files in templates/ or files excluded by .helmignore. Files in files/ are not rendered, so if they need values, wrap with tpl (.Files.Get "files/nginx.conf") ..
More on Chart Structure & Metadata
What files does `helm create mychart` generate and which ones matter?BeginnerWhat are the required fields in `Chart.yaml`?BeginnerWhat is the difference between `version` and `appVersion`?BeginnerWhy should `appVersion` be quoted in `Chart.yaml`?BeginnerWhat does `type: library` vs `type: application` mean?BeginnerWhat is the `kubeVersion` field used for?Intermediate