【问题标题】:How to download a helm chart as a file for templating?如何将掌舵图下载为模板文件?
【发布时间】:2021-04-16 12:48:07
【问题描述】:

我可以成功地将掌舵图推送到我的港口注册表:

helm registry login -u robot$myrobo -p ... https://myregistry.mycompany.com
helm chart save mychart.gz myregistry.mycompany.com/myrepo/mychart:0.0.0-1 
helm chart push myregistry.mycompany.com/myrepo/mychart:0.0.0-1

我也可以拉图表:

helm registry login -u robot$myrobo -p ... https://myregistry.mycompany.com
helm chart pull myregistry.mycompany.com/myrepo/mychart:0.0.0-1

两个命令都成功了,但现在我想运行

helm template name path/to/the/chart/I/just/downloaded -f another_file | further_processing

但是path/to/the/chart/I/just/downloaded 不存在。它曾经使用 helm 2 和另一个注册表,但现在(使用 helm3)该文件似乎没有在某处物理下载。

除了缓存https://helm.sh/docs/topics/registries/#where-are-my-charts 之外,我可能会解析 index.json 并以某种方式获取我的数据,但这是不希望的。有没有一种方便的方法可以在模板命令中访问我的文件?

论文集:

Rafał Leszko 的回答:

我试过了:

$ helm pull myregistry.mycompany.com/myrepo/mychart:0.0.0-1
Error: repo myregistry.mycompany.com not found
$ helm pull myrepo/mychart:0.0.0-1
Error: repo myrepo not found

我知道没有错别字,因为helm chart pull myregistry.mycompany.com/myrepo/mychart:0.0.0-1 成功了。

【问题讨论】:

    标签: kubernetes-helm harbor helm3


    【解决方案1】:

    使用 Helm 3,您可以使用 helm pull 命令。它将给定的 helm chart 下载到当前目录。

    尝试以下命令。那里工作正常。

    helm pull hazelcast/hazelcast
    helm template hazelcast hazelcast-*.tgz
    

    【讨论】:

    • 这对我不起作用。对于helm pull myrepo/mychart:0.0.0-1,我得到Error: repo myrepo not found
    猜你喜欢
    • 2019-03-15
    • 2020-06-12
    • 1970-01-01
    • 1970-01-01
    • 2021-08-25
    • 2021-06-13
    • 2019-07-28
    • 1970-01-01
    • 2017-04-08
    相关资源
    最近更新 更多