Tiller pods can‘t connect to k8s apiserver,dial tcp 10.254.0.1:443: no route to host

1. 问题

使用helm list查看本地安装应用时,报错

# helm list

Error: Get https://10.254.0.1:443/api/v1/namespaces/kube-system/configmaps?labelSelector=OWNER%!D(MISSING)TILLER: dial tcp 10.254.0.1:443: no route to host

使用helm version正常,但是使用helm list报错。


2. 解决

原因是Tiller pods can’t connect to k8s apiserver,解决办法是不再使用自己创建的service-account,而使用系统默认的。

// helm初始化
# helm init --upgrade -i registry.ctzcdn.com/devops/tiller:v2.12.0 --tiller-namespace=kube-system --service-account default

// 给serviceaccount绑定cluster-admin规则
# kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:default

如果是已经运行的tiller,则需要修改tiller-deploy.yaml的spec.template.spec.serviceAccount的值为default。

# kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"default"}}}}'

3. 参考链接

https://github.com/helm/helm/issues/2464

猜你喜欢

转载自blog.csdn.net/yjk13703623757/article/details/108398079