Helm - 如何从 repo 为子图添加秘密?

Helm - how to add secrets for subchart from repo?

我从 bitnami 安装了 mongodb chart,如下所示

helm install mongodb bitnami/mongodb 

创建了这个文件 ./charts/mongodb-10.15.2.tgz

我不明白和找不到的是如何 link 这些子图的秘密。我知道 values.yaml 可以覆盖子子图。真正让我感到困惑的是,这个下载的子图只是编码文件,我完全不知道如何根据 deployment/service...

来弯曲它

因此我的问题是,如何为这个子图(我对此一无所知)提供像 dbpassword、dbroot... 这样的秘密? (我希望这些秘密不是通过 values.yaml 覆盖提供的)

当您有子图表时,您可能会将它们映射为 dependency (look at the condition carefully, that will match with your values.yaml of the same parent chart.), and here 是您传递子图表值的方式。

现在,我相信你正在使用 this mongodb chart, and in case you want to pass the passwords, you might want to create a k8s secret object and pass the name here

现在让我们说, 有一个图表A和MongoDB是图表A的子图表, 如果您将 MongoDB 添加为 this, you can put the configuration/values of chart MongoDB, in A values, just like this.

之类的依赖项

现在,对于密文,在MongoDB的values.yaml中有提到,你可以创建一个自定义密文,并在其中传递相同的名称,如果仍然不满意,你可能想要将 env vars directly 传递给 MongoDB 图表值。

最重要的是,当您将任何图表定义为依赖图表或子图表时,您会知道它是哪个图表以及它采用的值是什么, 您可以在父图表中嵌套相同的值。

当你有更多时间时,你可以花一些 here :)