根据 Helm 图表设置值 [英] Set value in dependency of Helm chart

查看:31
本文介绍了根据 Helm 图表设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 postgresql 图表 作为我的要求掌舵图.

I want to use the postgresql chart as a requirements for my Helm chart.

我的 requirements.yaml 文件看起来像这样:

My requirements.yaml file hence looks like this:

dependencies:
  - name: "postgresql"
    version: "3.10.0"
    repository: "@stable"

在 postgreSQL Helm 图表中,我现在想使用属性 postgresqlUsername 设置用户名(请参阅 https://github.com/helm/charts/tree/master/stable/postgresql 所有属性).

In the postgreSQL Helm chart I now want to set the username with the property postgresqlUsername (see https://github.com/helm/charts/tree/master/stable/postgresql for all properties).

我必须在我的项目中的何处指定此属性,以便将其传播到 postgreSQL 依赖项?

Where do I have to specify this property in my project so that it gets propagated to the postgreSQL dependency?

推荐答案

https://v2.helm.sh/docs/chart_template_guide/#subcharts-and-global-values,在您的父级(即不是依赖项)图表的 values.yaml 文件,有一个部分包含

As described in https://v2.helm.sh/docs/chart_template_guide/#subcharts-and-global-values, in your parent (i.e. not the dependency) chart's values.yaml file, have a section that contains

postgresql:
  postgresUsername: ....
  postgresPassword: ....
  ...

也就是说,postgresql 键下的所有值都将覆盖子 (postgresql) 图表的 values.yaml 值.请注意,如果您在 requirements.yaml 中将 postgresql 依赖关系图别名为另一个名称,则应使用该其他名称而不是 postgresql.

That is, all values under the postgresql key will override the child (postgresql) chart's values.yaml values. Note that if you have aliased the postgresql dependency chart to another name in your requirements.yaml, you should use that other name instead of postgresql.

v3中对应的文章在这里https://helm.sh/docs/chart_template_guide/subcharts_and_globals/

edit: The corresponding article in v3 is here https://helm.sh/docs/chart_template_guide/subcharts_and_globals/

这篇关于根据 Helm 图表设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆