如何将舵图下载为模板文件?

问题描述

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

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 成功了。

解决方法

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

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

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