【问题标题】:how to build umbrella chart with exact dependency helm chart version in requirements.yaml file如何在 requirements.yaml 文件中构建具有精确依赖 helm 图表版本的伞形图表
【发布时间】:2018-08-24 16:02:02
【问题描述】:

我们有微服务应用程序,它为每个 MS 提供不同的 helm 图表,并且有一个伞形图表可以添加所有这些图表并创建一个集成图表以进行简单的部署,我们使用 Nexus3 作为 helm repo。
在伞形图中requirements.yaml 依赖项添加了版本、存储库。
当我们在requirements.yaml 中指定确切的图表版本时,有时它无法在nexus repo 中找到该图表,尽管它确实存在。经过一番调查,发现它在该 nexus repo 的 index.yaml 中查找版本,如果所需版本与 index.yaml 文件中的版本不同,它将失败。
index.yaml 始终包含最新版本,但是什么如果我们想使用与最新版本不同的版本?我们该如何解决这个问题?
下面是requirements.yaml文件的sn-p

dependencies: - name: ms1 version: "1.3.0" repository: http://user:passwd@nexus_host:8081/repository/helm_chart_repo/ms1 - name: ms2 version: "1.3.0" repository: http://user:passwd@nexus_host:8081/repository/helm_chart_repo/ms2 - name: ms3 version: "1.2.0" repository: http://user:passwd@nexus_host:8081/repository/helm_chart_repo/ms3 - name: ms4 version: "1.3.1" repository: http://user:passwd@nexus_host:8081/repository/helm_chart_repo/ms4

【问题讨论】:

    标签: nexus kubernetes-helm nexus3


    【解决方案1】:

    如果需要的Helm Chart版本在repository中存在,但index.yaml中不存在,那么说明你的index.yaml不正确。它应该包含存储库中的所有版本。

    检查helm repo index <directory>是否总是在添加新版本后执行。

    【讨论】:

    • 你是对的,尽管我们使用helm repo index <chartdir> --url <remote repo> --merge index.yaml,但我们总是缺少index.yaml 中的所有其他版本,但总是最新版本除外
    • 发现问题出在我们的自动化代码上:(。逻辑是这样的,从远程下载index.yaml,将其与本地合并并上传回远程。但是下载有问题来自远程的index.yaml,导致总是将新文件上传到远程。修复下载代码后,它按预期工作(index.yaml 现在在远程有多个版本)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-09
    • 2017-10-10
    • 1970-01-01
    • 1970-01-01
    • 2018-08-31
    • 2022-12-22
    • 2020-03-25
    相关资源
    最近更新 更多