【问题标题】:Helm: could not find tillerHelm:找不到舵柄
【发布时间】:2019-01-09 19:58:09
【问题描述】:

我收到此错误消息:

➜  ~ helm version
Error: could not find tiller

我已经创建了tiller 项目:

➜  ~ oc new-project tiller
Now using project "tiller" on server "https://192.168.99.100:8443".

然后,我在tiller 命名空间中创建了tiller

➜  ~ helm init --tiller-namespace tiller
$HELM_HOME has been configured at /home/jcabre/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!

所以,在那之后,我一直在等待tiller pod 准备就绪。

➜  ~ oc get pod -w
NAME                             READY     STATUS    RESTARTS   AGE
tiller-deploy-66cccbf9cd-84swm   0/1       Running   0          18s
NAME                             READY     STATUS    RESTARTS   AGE
tiller-deploy-66cccbf9cd-84swm   1/1       Running   0          24s
^C%               

有什么想法吗?

【问题讨论】:

    标签: openshift kubernetes-helm


    【解决方案1】:

    尝试删除集群分蘖

    kubectl get all --all-namespaces | grep tiller
    kubectl delete deployment tiller-deploy -n kube-system
    kubectl delete service tiller-deploy -n kube-system
    kubectl get all --all-namespaces | grep tiller
    

    再次初始化:

    helm init
    

    现在添加服务帐号:

    kubectl create serviceaccount --namespace kube-system tiller
    kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
    kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
    

    这解决了我的问题!

    【讨论】:

    • 在最后一个kubectl patch 命令上,它给了我错误Error from server (NotFound): deployments.apps "tiller-deploy" not found
    • 从 3.0 版开始,不再需要 helm init 并且分蘖消失了
    • @theduck 第一个命令 kubectl get all --all-namespaces | grep tiller 给出以下输出: tiller service/tiller-deploy ClusterIP 10.104.79.35 44134/TCP 3h58m tiller deployment.apps/tiller-deploy 0/1 0 0 3h58m 但是,当我尝试删除部署/服务时没有找到。 kubectl delete deployment tiller-deploy -n kube-system 服务器错误(未找到):deployments.extensions "tiller-deploy" not found
    【解决方案2】:

    你还没有配置helm,使用如下命令:

    helm init
    

    这将在您的主目录中创建带有repositoryplugins 等的.helm

    背景: helm自带client和server,如果你的部署环境不同,可能你的helm server(称为tiller)不一样,那么有两种方式指向tiller

    • 设置环境变量TILLER_NAMESPACE
    • --tiller-namespace Tiller 的字符串命名空间(默认为“kube-system”)

    更多详情请查看helmREAD.md文件。

    【讨论】:

    • @Jordi 如果您认为这回答了您的问题,请接受。否则,请发布您的进一步查询。
    【解决方案3】:

    您将 tiller 安装到非默认命名空间中,因此您必须告诉 helm 去哪里查找。

    helm --tiller-namespace tiller  version
    

    【讨论】:

    • 那行得通。由于我已经通过 terraform 安装了 tiller,因此我自动添加了一个命名空间。当心!
    【解决方案4】:

    首先你需要创建一个服务账号,供柜员在 helm 中使用:

    kubectl -n kube-system create serviceaccount tiller
    kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
    helm init --service-account tiller
    

    验证 Tiller 是否正在运行:

    kubectl get pods --namespace kube-system
    

    DigitalOcean Reference

    【讨论】:

    • helm init --service-account tiller 返回Error: unknown flag: --service-account
    • admin1@POC-k8s-master:~/poc-cog/metrics-server$ kubectl get pods --namespace kube-system NAME READY STATUS RESTARTS AGE tiller-deploy-86f55698f8-xf5d5 1/1运行 0 29s
    • admin1@POC-k8s-master:~/poc-cog/metrics-server$ helm ls Error: Get 10.96.0.1:443/api/v1/namespaces/kube-system/…: dial tcp 10.96.0.1:443: i/o timeout admin1@POC -k8s-master:~/poc-cog/metrics-server$ helm init $HELM_HOME 已在 /home/admin1/.helm 中配置。错误:安装错误:服务器找不到请求的资源
    • 这是因为您的舵柄版本。检查这个Helm Github Ref
    【解决方案5】:

    现在您可以升级到最新版本的 Helm 或任何版本 > 3.0.0。

    你不需要这样做

    helm init
    

    不再

    当您开始使用 helm 时,会自动初始化 Tiller 和客户端目录。如前所述here

    【讨论】:

      【解决方案6】:

      我遇到了同样的问题,尝试使用以下命令重新安装 helm:

      对于 linux:(通过 Snap)

      sudo snap install helm --classic

      对于 Linux(来自二进制源):

      1. 下载您想要的版本
      2. 解压(tar -zxvf helm-v2.0.0-linux-amd64.tgz)
      3. 在解压后的目录中找到 helm 二进制文件,并将其移动到所需的目的地 (mv linux-amd64/helm /usr/local/bin/helm)

      对于 MacOS(通过 brew):

      brew install kubernetes-helm

      对于 Windows(通过 Chocolatey):

      choco install kubernetes-helm

      最后,初始化helm

      helm init
      

      【讨论】:

        【解决方案7】:

        在 helm 3 版本中,我们不再需要分蘖。尝试将 helm 版本升级到 3。它为您的集群提供了更高的安全性。因为 tiller 在您的 Kubernetes 集群中运行具有完全的管理权限,如果有人未经授权访问集群,这是一个风险。 如果您迁移到 helm3,则此后无需执行 helm init,因为 helm 版本 3 是一种无分蘖架构。

        【讨论】:

          【解决方案8】:

          试试

          cp /usr/local/bin/tiller ~/.helm/
          

          并检查 helm 是否部署在服务器上

          helm version
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2021-03-12
            • 1970-01-01
            • 1970-01-01
            • 2022-11-24
            • 2022-11-10
            • 2021-12-09
            • 2021-03-31
            • 2023-03-18
            相关资源
            最近更新 更多