【问题标题】:`Error: could not find tiller` when running `helm version`运行`helm version`时`错误:找不到分蘖`
【发布时间】:2020-01-25 12:10:17
【问题描述】:

我安装了minikubekubectl

$ minikube version
minikube version: v1.4.0
commit: 7969c25a98a018b94ea87d949350f3271e9d64b6

$ 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"}

然后我按照https://helm.sh/docs/using_helm/的指示进行操作:

  1. 我已经下载了https://get.helm.sh/helm-v2.13.1-linux-amd64.tar.gz

  2. 我跑了

$ tar -xzvf Downloads/helm-v2.13.1-linux-amd64.tar.gz linux-amd64/
linux-amd64/LICENSE
linux-amd64/tiller
linux-amd64/helm
linux-amd64/README.md

但是现在,如果我检查我的 helm 版本,我会得到:

$ helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Error: could not find tiller

我尝试运行helm init,但得到以下结果:

$ helm init
$HELM_HOME has been configured at /home/SERILOCAL/<my-username>/.helm.
Error: error installing: the server could not find the requested resource

如何让helm 正确初始化?

【问题讨论】:

  • 这不是关于“程序员常用的软件工具”的问题吗?
  • 不管怎样,很高兴我得到了答案,尽管投了反对票:)
  • Helm v2.15.0 已发布,helm init 现在使用 apiVersion apps/v1 安装 Tiller 部署,使其与新版本的 Kubernetes 兼容。

标签: linux kubernetes kubernetes-helm kubectl minikube


【解决方案1】:

我遇到了同样的问题,@shawndodo 给我看了这个https://github.com/helm/helm/issues/6374#issuecomment-533427268

helm init --service-account tiller --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -

你可以试试这个。 (发布于this question

【讨论】:

    【解决方案2】:

    当前 helm 版本不适用于 kubernetes 版本 1.16.0

    您可以将 kubernetes 降级到 1.15.3 版本

    minikube start --kubernetes-version 1.15.3
    helm init 
    

    或使用我的解决方案将其修复为 1.16.0 版本

    您必须创建分蘖 Service AccountClusterRoleBinding

    您可以使用这些命令简单地做到这一点:

    kubectl --namespace kube-system create sa tiller
    kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
    

    然后简单地创建分蘖

    helm init --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -
    

    【讨论】:

    • 哇,非常感谢!没想到这一点,你帮助我解决了我一直坚持的事情,我很自豪地承认
    • 谢谢你。我决定在午夜之前升级并遇到这个=,=
    猜你喜欢
    • 2020-01-29
    • 2020-08-07
    • 2019-08-27
    • 2021-12-31
    • 2020-06-05
    • 2019-12-17
    • 1970-01-01
    • 2020-08-14
    • 1970-01-01
    相关资源
    最近更新 更多