Code reuse in manifest files

We have a bunch of common snippets (pod annotations, ingress annotations) in our manifest files to configure helm charts, is there a way to use yaml imports or something to increase code reuse?

You mean like using Helm template functions? For example

{{- with .Values.podAnnotations }}
annotations:
    {{- toYaml . | nindent 8 }}
{{- end }}

Not really, let say, 2 helm charts, with each their own kind: HelmChart and both needing 5 of the same pod annotations, (and I do not want to put them in an umbrella chart)

How about using a ConfigValue that is hidden. You can pass it via the values from the HelmChart file and it will be automatically set using for example the podAnnotations snippet I shared before.

1 Like

Ah, did not think about that, smart! Thx

1 Like