查看tiller是否已经起来
root@nav8:~# kubectl get pods -n kube-system | grep tiller
tiller-deploy-65ff9d5d97-q5sl6 1/1 Running 0 21m
root@n:/usr/local/bin# helm version
Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
Error: could not find a ready tiller pod
- 对应的pod已经running;
- apt-get install socat (ubuntu)
yum install socat -y (centos)
[root@d]# helm version
Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
E1022 16:27:57.047815 28426 portforward.go:331] an error occurred forwarding 33023 -> 44134: error forwarding port 44134 to pod 612a0e878789aa021c80b3d2f7e7514fba75c908a0da285205c13c06b5605c02, uid : unable to do port forwarding: socat not found.
Error: cannot connect to Tiller
#############################################
$helm version
如果报错如下:
Client: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
E0921 16:19:09.448738 24295 portforward.go:331] an error occurred forwarding 39401 -> 44134: error forwarding port 44134 to pod 5b85aa2aa4347d59ea30edf466a7e01a198780151d30644a16b5cab4ceb2b83d, uid : unable to do port forwarding: socat not found.
Error: cannot connect to Tiller
解决办法:在k8s的node节点安装ssocat即可解决
$sudo yum install socat
遇到的另外一个问题,$helm list -a,报错 Error: the server has asked for the client to provide credentials (get configmaps)
解决方法:
.创建sericeaccount
$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"}}}}'
.run helm
$helm init --service-account tiller --tiller-image 4admin2root/tiller:v2.6.0 --upgrade
删除Tiller:
$helm reset 或 $helm reset -f(强制删除k8s集群上的pod.)
当要移除helm init创建的目录等数据时,执行helm reset --remove-helm-home
####################################################
unset HELM_HOST(之前设置了HELM_HOST为127.0.0.1:44134,而且更改了svc tiller-deploy为NodePort)
卸载后(移除tiller相关svc,deploy以及/root/.helm目录),重新安装
- 卸载
helm reset将会移除tiller在k8s集群上创建的pod
当出现上面的context deadline exceeded时, helm reset同样会报该错误.执行heml reset -f强制删除k8s集群上的pod.
当要移除helm init创建的目录等数据时,执行helm reset --remove-helm-home
- 补充
2.5版本安装的tiller,在出现context deadline exceeded时,使用2.4版本的helm执行heml reset --remove-helm-home --force并不能移除tiller创建的pod和配置.这是2.4版本的问题.