繁体   English   中英

在依赖关系图中覆盖 values.yaml - MongoDb

[英]Override values.yaml in a dependency chart - MongoDb

我有一个 requirements.yaml 文件:

dependencies:
  - name: mongodb-replicaset
    # Can be found with "helm search <chart>"
    version: 3.13.0
    # This is the binaries repository, as documented in the GitHub repo
    repository: https://kubernetes-charts.storage.googleapis.com/

我想修改 mongodb-replicaset 图表的 values.yaml 文件,尤其是这部分:

auth:

  enabled: false
  existingKeySecret: ""
  existingAdminSecret: ""
  existingMetricsSecret: ""
  # adminUser: username
  # adminPassword: password
  # metricsUser: metrics
  # metricsPassword: password
  # key: keycontent

如何在依赖关系图中的初始化时覆盖 values.yaml 文件?

您将值放在与上游图表名称匹配的键下,以便

mongodb-replicaset:
  auth:
    enabled: true
    etc etc

我会说工作流程可以是下一个:

1) 使用helm 依赖更新在本地下载所有内容 - 当 helm 依赖更新检索图表时,它会将它们作为图表存档存储在 charts/ 目录中。

来自官方文档的示例

$ helm dep up foochart
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "example" chart repository
...Successfully got an update from the "another" chart repository
Update Complete.
Saving 2 charts
Downloading apache from repo http://example.com/charts
Downloading mysql from repo http://another.example.com/charts

2) 按照@coderanger 的建议更改 mongodb-replicaset 图表下的 values.yaml

3)使用本地下载|\\修改文件部署舵图

另一种选择是检查:父 values.yaml 图表配置文件。 根据子图和全局值

- 子图被认为是“独立的”,这意味着子图永远不能明确依赖其父图。

- 因此,子图无法访问其父图的值。

- 父图表可以覆盖子图表的值。

-Helm 有一个全局值的概念,所有图表都可以访问。

请查看子图表和全局值文档的“覆盖父图表中的值”部分 - 它有一个示例如何使用全局值覆盖子图表值。

希望能帮助到你

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM