在官网下载指定想要版本的helm并传入服务器:https://github.com/helm/helm/releases
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.15.2-linux-amd64.tar.gz
tar zxvf helm-v2.15.2-linux-amd64.tar.gz
mv helm /usr/local/bin/
查看helm版本
helm version
创建rbac-config.yaml,并输入以下内容:
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
然后执行kubectl create -f rbac-config.yaml
以上步骤配置成功后,安装tiller。(和helm client对应的版本一样)
## 使用阿里云镜像
helm init --service-account tiller --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.15.2 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
查看tiller是否安装成功
[root@dev5 helm]# kubectl get pod -n kube-system -l app=helm
NAME READY STATUS RESTARTS AGE
tiller-deploy-64554479cd-dwgxj 1/1 Running 0 50s
再次查看helm version确认
[root@dev5 helm]# helm version
Client: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}
E0303 11:07:51.524825 19885 portforward.go:400] an error occurred forwarding 36679 -> 44134: error forwarding port 44134 to pod adbe6af74d104b2fb04d5a1033e62ec860e1da56bba99fea6e87b417cf67428c, uid : unable to do port forwarding: socat not found.
E0303 11:07:52.570831 19885 portforward.go:400] an error occurred forwarding 36679 -> 44134: error forwarding port 44134 to pod adbe6af74d104b2fb04d5a1033e62ec860e1da56bba99fea6e87b417cf67428c, uid : unable to do port forwarding: socat not found.
E0303 11:07:54.348804 19885 portforward.go:400] an error occurred forwarding 36679 -> 44134: error forwarding port 44134 to pod adbe6af74d104b2fb04d5a1033e62ec860e1da56bba99fea6e87b417cf67428c, uid : unable to do port forwarding: socat not found.
E0303 11:08:27.335220 19885 portforward.go:340] error creating error stream for port 36679 -> 44134: Timeout occured
发现
- unable to do port forwarding: socat not found
解决办法在node节点安装socat
yum install socat