首页 > 解决方案 > `helm init` 说分蘖已经在集群上,但不是吗?

问题描述

vagrant@ubuntu-xenial:~$ helm init 
$HELM_HOME has been configured at /home/vagrant/.helm.
Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)
vagrant@ubuntu-xenial:~$ helm ls
Error: could not find tiller

我该如何进一步诊断?

以下是当前正在运行的 pod kube-system

vagrant@ubuntu-xenial:~$ kubectl get pods -n kube-system
NAME                                      READY   STATUS      RESTARTS   AGE
canal-dlfzg                               2/2     Running     2          72d
canal-kxp4s                               2/2     Running     0          29d
canal-lkkbq                               2/2     Running     2          72d
coredns-86bc4b7c96-xwq4d                  1/1     Running     2          49d
coredns-autoscaler-5d5d49b8ff-l6cxq       1/1     Running     0          49d
metrics-server-58bd5dd8d7-tbj7j           1/1     Running     1          72d
rke-coredns-addon-deploy-job-h4c4q        0/1     Completed   0          49d
rke-ingress-controller-deploy-job-mj82v   0/1     Completed   0          49d
rke-metrics-addon-deploy-job-tggx5        0/1     Completed   0          72d
rke-network-plugin-deploy-job-jzswv       0/1     Completed   0          72d

标签: kuberneteskubernetes-helm

解决方案


问题在于部署/服务帐户不存在。

vagrant@ubuntu-xenial:~$ kubectl get deployment tiller-deploy --namespace kube-system
NAME            READY   UP-TO-DATE   AVAILABLE   AGE
tiller-deploy   0/1     0            0           24h


vagrant@ubuntu-xenial:~$ kubectl get events --all-namespaces
kube-system     4m52s       Warning   FailedCreate    replicaset/tiller-deploy-7f4d76c4b6                 Error creating: pods "tiller-deploy-7f4d76c4b6-" is forbidden: error looking up service account kube-system/tiller: serviceaccount "tiller" not found

我删除了部署并helm init再次运行,然后运行:

kubectl delete deployment tiller-deploy --namespace kube-system
helm init

推荐阅读