如何解决 https://kubernetes-charts.storage.googleapis.com" 不是有效的图表存储库

Rah*_*mar 24 kubernetes

我正在研究 helm 2 并尝试将 Tiller 部署为 pod。

>helm init --service-account tiller
Run Code Online (Sandbox Code Playgroud)

但我得到以下错误:错误:错误初始化:看起来像“ https://kubernetes-charts.storage.googleapis.com ”不是有效的图表存储库或无法访问:获取https://kubernetes-charts.storage .googleapis.com/index.yaml:拨号 tcp 172.217.2.240:443:连接:连接超时

有没有人遇到过这个错误,如果是,为 helm2 克服这个问题的推荐方法是什么?

小智 49

之前的 Helm 版本2.17.0将弃用的https://kubernetes-charts.storage.googleapis.com/index.yaml作为默认稳定存储库,不再解析。新的存储库是https://charts.helm.sh/stable。您可以选择:

  1. 使用 --stable-repo-url参数指定新的存储库:

    helm init --stable-repo-url https://charts.helm.sh/stable --service-account tiller
    
    Run Code Online (Sandbox Code Playgroud)
  2. 使用 --skip-refresh 参数并替换稳定的存储库:

    helm init --client-only --skip-refresh
    helm repo rm stable
    helm repo add stable https://charts.helm.sh/stable
    
    Run Code Online (Sandbox Code Playgroud)
  3. 将 helm 升级到2.17.0或更高版本。


小智 17

helm init --client-only --skip-refresh
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable
Run Code Online (Sandbox Code Playgroud)

  • 如果添加解释/细节,只有代码答案才能更有价值。 (3认同)

Vit*_*Vit 1

只是为了历史,也许其他人也会面临。社区解答。

此类错误"Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 172.217.2.240:443: connect: connection timed out"通常是由于代理和非直接连接问题造成的。

这在相关的 github 问题Cannot Perform helm init Behind proxy中进行了讨论,很多人都有同样的问题。根据主题 - 用户可能会在使用某些 helm 版本时遇到此类问题。建议从v2.11.0开始使用