Helm 在本地导出 YAML 文件(只使用模板引擎,不发送到 Kubernetes)
Helm export YAML files locally (just use templating engine, do not send to Kubernetes)
我想将已经模板化的 Helm 图表导出为 YAML 文件。我目前无法在我的 Kubernetes 集群上使用 Tiller,但仍想使用 Helm Charts。基本上,我希望 Helm 使用 Helm 模板化的值导出发送到 Kubernetes API 的 YAML。之后,我会将 YAML 文件上传到我的 Kubernetes 集群。
我尝试 运行 .\helm.exe install --debug --dry-run incubator\kafka
但我收到错误 Error: Unauthorized
。
请注意,我 运行 Helm on Windows(版本 helm-v2.9.1-windows-amd64)。
我们需要日志来检查 Unauthorized
问题。
但您可以轻松地在本地生成模板:
helm template mychart
Render chart templates locally and display the output.
This does not require Tiller. However, any values that would normally
be looked up or retrieved in-cluster will be faked locally.
Additionally, none of the server-side testing of chart validity (e.g.
whether an API is supported) is done.
直接来自 helm install --help
To check the generated manifests of a release without installing the chart,
the '--debug' and '--dry-run' flags can be combined. This will still require a
round-trip to the Tiller server.
Amrit Bera 的解决方案将仅适用于本地 helm chart,根据您希望它与远程 helm chart 一起使用的问题的详细信息,该功能将添加到 Helm v3(目前正在进行中)。
RehanSaeed 发布了以下解决方法 (https://github.com/helm/helm/issues/4527)
基本上:
mkdir yamls
helm fetch --untar --untardir . 'stable/redis' #makes a directory called redis
helm template --output-dir './yamls' './redis' #redis dir (local helm chart), export to yamls dir
这样做的好处是您可以将此技术与 weaveworks flux 混合用于 git ops + 除了 Tiller 插件(它让您 运行 局部分蘖,但工作不顺利)。
我想将已经模板化的 Helm 图表导出为 YAML 文件。我目前无法在我的 Kubernetes 集群上使用 Tiller,但仍想使用 Helm Charts。基本上,我希望 Helm 使用 Helm 模板化的值导出发送到 Kubernetes API 的 YAML。之后,我会将 YAML 文件上传到我的 Kubernetes 集群。
我尝试 运行 .\helm.exe install --debug --dry-run incubator\kafka
但我收到错误 Error: Unauthorized
。
请注意,我 运行 Helm on Windows(版本 helm-v2.9.1-windows-amd64)。
我们需要日志来检查 Unauthorized
问题。
但您可以轻松地在本地生成模板:
helm template mychart
Render chart templates locally and display the output.
This does not require Tiller. However, any values that would normally be looked up or retrieved in-cluster will be faked locally. Additionally, none of the server-side testing of chart validity (e.g. whether an API is supported) is done.
直接来自 helm install --help
To check the generated manifests of a release without installing the chart,
the '--debug' and '--dry-run' flags can be combined. This will still require a
round-trip to the Tiller server.
Amrit Bera 的解决方案将仅适用于本地 helm chart,根据您希望它与远程 helm chart 一起使用的问题的详细信息,该功能将添加到 Helm v3(目前正在进行中)。
RehanSaeed 发布了以下解决方法 (https://github.com/helm/helm/issues/4527)
基本上:
mkdir yamls
helm fetch --untar --untardir . 'stable/redis' #makes a directory called redis
helm template --output-dir './yamls' './redis' #redis dir (local helm chart), export to yamls dir
这样做的好处是您可以将此技术与 weaveworks flux 混合用于 git ops + 除了 Tiller 插件(它让您 运行 局部分蘖,但工作不顺利)。