How can you call a helm 'helper' template from a subchart with the correct context?

后端 未结 3 1388
情歌与酒
情歌与酒 2021-02-02 15:16

Helm charts define helper templates in _helpers.tpl which are used to create normalized names for the services. The standard form of the template for a service (DNS

3条回答
  •  故里飘歌
    2021-02-02 15:36

    I'm very green with Helm so I could be spouting bad practice (though I don't think so). From what I understand a named template is available globally to all parent and subcharts. This is not true however, for values. Parent values are not accessible to a sub chart but subchart values can be accessed by a parent.

    Quoted from https://docs.helm.sh/chart_template_guide/#declaring-and-using-templates-with-define-and-template ...

    "There is one really important detail to keep in mind when naming templates: template names are global. If you declare two templates with the same name, whichever one is loaded last will be the one used. Because templates in subcharts are compiled together with top-level templates, you should be careful to name your templates with chart-specific names."

    Reference:
    https://docs.helm.sh/chart_template_guide/#named-templates https://docs.helm.sh/chart_template_guide/#subcharts-and-global-values

提交回复
热议问题