helm template --debug 或 helm install --dry-run --debug ,哪个最好?

Eri*_*ucy 19 kubernetes-helm

我想知道helm template --debug 和 之间哪个最好helm install --dry-run --debug

谢谢

Dav*_*aze 16

这两个命令之间的区别在于,它将helm install --dry-run发送内容到 Kubernetes 集群,但helm template不会。

我的一般经验是,调试复杂的 Go 模板可能会很棘手,如果我遇到 YAML 问题(特别是如果我在浏览器选项卡中有 Kubernetes API 文档),输出helm template足以满足我的需求,并且速度更快,依赖性也更少。所以我经常使用helm template.

相比之下,当我获得正确的 Go 模板逻辑和 YAML 格式时,我通常已经准备好实际进行测试部署;所以当我helm install几乎从不与--dry-run. 如果我的对象布局错误,这仍然会抱怨,如果正确,那么我就准备开始向服务发送请求。


Mat*_*s M 14

这是对大卫答案的补充

我总是用helm template --debug

开发 helm 模板时的一个常见问题是空格错误(例如不正确的缩进)。

only helm template --debug(但既不是helm installplain 也不是helm template)会生成无效的 yaml,可用于轻松调试,因为 helm 错误消息很少有帮助。