Search code examples
kuberneteskubernetes-helm

Helm Conditional Templates


I found that we can create subcharts and conditionally include them as described here: Helm conditionally install subchart

I have just one template that I want conditionally include in my chart but I could not find anything in the docs. Is there such feature?


Solution

  • I discovered that empty templates are not loaded. I solved it by wrapping my yaml file content in an if condition.

    {{ if .Values.something }}
    content of yaml file
    {{ end }}