当前位置:   article > 正文

解决k8s helm安装tiller出现ImagePullBackOff,ErrImagePull错误_tiller is already installed in the cluster

tiller is already installed in the cluster

使用helm安装tiller

helm init --service-account=tiller --tiller-image=gcr.io/kubernetes-helm/tiller:v2.17.0
  • 1

返回

$HELM_HOME has been configured at /root/.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.)
[root@k8s-master helm]# helm version
Client: &version.Version{SemVer:"v2.17.0", GitCommit:"a690bad98af45b015bd3da1a41f6218b1a451dbe", GitTreeState:"clean"}
Error: could not find a ready tiller pod

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

查看pod状态

kubectl get pods -n kube-system
  • 1

结果 tiller-deploy-7555cf9759-sv8rj 出现 ErrImagePull:

coredns-6d56c8448f-k224x             1/1     Running        1          12d
etcd-k8s-master                      1/1     Running        10         12d
kube-apiserver-k8s-master            1/1     Running        23         12d
kube-controller-manager-k8s-master   1/1     Running        134        12d
kube-flannel-ds-gmj98                1/1     Running        0          5d
kube-flannel-ds-jpn79                1/1     Running        1          5d22h
kube-flannel-ds-zfjbv                1/1     Running        0          5d
kube-proxy-bld8q                     1/1     Running        0          5d
kube-proxy-gpn26                     1/1     Running        0          5d
kube-proxy-zh9t5                     1/1     Running        4          12d
kube-scheduler-k8s-master            1/1     Running        134        12d
tiller-deploy-7555cf9759-sv8rj       0/1     ErrImagePull   0          25s

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

查看tiller-deploy-7555cf9759-sv8rj pod日志信息

kubectl describe pod tiller-deploy-7555cf9759-sv8rj -n kube-system
  • 1

出现pull image error提示ErrImagePull

Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   BackOff    3d15h (x2 over 3d15h)  kubelet            Back-off pulling image "gcr.io/kubernetes-helm/tiller:v2.17.0"
  Warning  Failed     3d15h (x2 over 3d15h)  kubelet            Error: ImagePullBackOff
  Normal   Pulling    3d15h (x3 over 3d15h)  kubelet            Pulling image "gcr.io/kubernetes-helm/tiller:v2.17.0"
  Warning  Failed     3d15h (x3 over 3d15h)  kubelet            Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.17.0": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed     3d15h (x3 over 3d15h)  kubelet            Error: ErrImagePull
  Normal   Scheduled  96s                    default-scheduler  Successfully assigned kube-system/tiller-deploy-7555cf9759-sv8rj to k8s-node1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

分析:gcr.io/kubernetes-helm/tiller:v2.17.0拉取镜像失败。

解决方法:

删除tiller deployment,顺带会一起删除tiller pod

kubectl delete -n kube-system deployment tiller-deploy
  • 1

或者

helm reset -f
  • 1

重新镜像安装

helm init --service-account=tiller --tiller-image=registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.17.0   --history-max 300
  • 1

再次查看tiller pod状态

kubectl get pods  -n kube-system
  • 1

出现Running说明tiller安装成功

kube-controller-manager-k8s-master   1/1     Running   134        12d
kube-flannel-ds-gmj98                1/1     Running   0          5d1h
kube-flannel-ds-jpn79                1/1     Running   1          5d23h
kube-flannel-ds-zfjbv                1/1     Running   0          5d1h
kube-proxy-bld8q                     1/1     Running   0          5d1h
kube-proxy-gpn26                     1/1     Running   0          5d1h
kube-proxy-zh9t5                     1/1     Running   4          12d
kube-scheduler-k8s-master            1/1     Running   134        12d
tiller-deploy-7d7cc8d4db-8jhww       1/1     Running   0          21s

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

查看helm版本

helm version
  • 1

出现以下安装

Client: &version.Version{SemVer:"v2.17.0", GitCommit:"a690bad98af45b015bd3da1a41f6218b1a451dbe", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.17.0", GitCommit:"a690bad98af45b015bd3da1a41f6218b1a451dbe", GitTreeState:"clean"}

  • 1
  • 2
  • 3

参考链接:

https://juejin.cn/post/6844904087234805767
https://www.jianshu.com/p/d0cdbb49569b

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/246612
推荐阅读
相关标签
  

闽ICP备14008679号