【问题标题】:Unable to deploy services using helm chart on Kubernetes cluster无法在 Kubernetes 集群上使用 helm chart 部署服务
【发布时间】:2019-09-25 22:59:12
【问题描述】:

我正在尝试在 kubernetes 集群上使用 helm chart 部署服务。它抛出错误为

“错误:非绝对 URL 的格式应为 repo_name/path_to_chart,得到:留言簿"

这是我正在部署的留言簿服务https://github.com/phcollignon/helm/tree/master/lab5_helm_chart_version1/

provider.helm v2.14.3

provider.kubernetes v1.16

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
$ helm install guestbook
Error: failed to download "guestbook" (hint: running `helm repo update` may help)
$ helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
$ helm install guestbook --debug
[debug] Created tunnel using local port: '39069'

[debug] SERVER: "127.0.0.1:39069"

[debug] Original chart version: ""
Error: Non-absolute URLs should be in form of repo_name/path_to_chart, got: guestbook

【问题讨论】:

  • 根据您尝试安装图表时的错误提示,您是否尝试过运行helm repo update?
  • 我做到了,仍然得到同样的错误。

标签: kubernetes kubernetes-helm


【解决方案1】:

您可以通过五种不同的方式来表达您想要安装的图表:

  1. 图表参考:helm install stable/mariadb
  2. 通过打包图表的路径:helm install ./nginx-1.2.3.tgz
  3. 通过解压图表目录的路径:helm install ./nginx
  4. 通过绝对 URL:helm install https://example.com/charts/nginx-1.2.3.tgz
  5. 通过图表参考和repo url:helm install --repo https://example.com/charts/ nginx

有使用选项编号的示例3

使用此命令下载 github 存储库:

git clone https://github.com/phcollignon/helm

然后转到 lab5_helm_chart_version1 文件

cd helm/lab5_helm_chart_version1

只需使用 helm install 创建留言簿

helm install chart/guestbook/ --name guestbook

【讨论】:

  • @VKR 作为 $ helm install guestbook/ --name guestbook 运行时出现以下错误错误:发布留言簿失败:命名空间“默认”被禁止:用户“system:serviceaccount:kube-system :default" 无法在命名空间 "default" 中获取 API 组 "" 中的资源 "namespaces"
  • 您的默认用户无权访问默认命名空间中的资源,请查看文档如何处理 rbac 以及如何授予用户访问权限
  • 提供您如何安装 helm 的分步信息
  • 看看@jt97 的答案之一 - 他已经解决了这个问题:stackoverflow.com/a/58101218/9929015
猜你喜欢
  • 2020-09-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-15
  • 2019-04-18
  • 2021-08-29
  • 1970-01-01
  • 2020-02-23
相关资源
最近更新 更多