【发布时间】:2020-12-25 19:52:00
【问题描述】:
我正在尝试使用 Jenkins 管道中的 helm 部署容器。我已经为 jenkins 安装了 Kubernetes 插件,并为其提供了本地运行的 kubernetes URL 和凭据中的配置文件。当我在做'Test connection' 时,它显示'Connected to Kubernetes 1.16+'。
但是当我从管道运行 helm install 命令时,它给出了错误
Error: Kubernetes cluster unreachable: the server could not find the requested resource
注意:我可以使用 CLI 和 Jenkins 管道执行所有操作,方法是使用 withCredentials 并传递 cred 文件变量名(在 jenkins 凭据中创建)。我只想这样做而不将其包装在 'withCredentials' 中。
Jenkins 和 kubernetes 都在 Windows 10 上单独运行。请帮助
【问题讨论】:
-
您使用的是哪个版本的
helm?您可以分享您尝试过的完整 helm 命令吗? -
@Bimal helm install app-name charts-dir -n nsname --set image=imagename --set nodePort=31200
标签: jenkins kubernetes kubernetes-helm multibranch-pipeline