首页 文章

掌舵干运行安装

提问于
浏览
9

我正在尝试使用 --dry-run 选项测试我的开发头盔聊天部署输出 . 当我运行以下命令时,它试图连接到Kubernetes API服务器 .

连接Kubernetes集群需要干运行选项吗?我只想检查部署yaml文件输出 .

helm install mychart-0.1.0.tgz --dry-run --debug

Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

2 回答

  • 12

    正如Helm's documentation所述

    如果要测试模板渲染,但实际上没有安装任何东西,可以使用helm install --debug --dry-run ./mychart . 这会将图表发送到Tiller服务器,该服务器将呈现模板 . 但是,它不会安装图表,而是将渲染的模板返回给您,以便您可以看到输出

    因此,它仍然需要连接到Tiller以使用正确的值呈现模板 . 使用--dry-run选项的不同之处在于它实际上不会安装图表 .

  • 18

    还有一个选项可以运行 helm template ./mychart 来渲染生成的YAML而无需连接到分蘖 . 结合 helm lint ,它是验证图表有效性的好方法 .

相关问题