Helm的安装
1、下载helm-v2.15.2这个版本
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
cd linux-amd64/
cp helm /usr/local/bin #拷贝到/usr/local/bin目录下
chmod +x /usr/local/bin/helm #添加执行权限
之前下载了helm-v2.12.1,接着安装tiller-v2.12.1失败。
于是改成安装helm-v2.15.2和tiller-v2.12.1,安装成功后输入helm ls,但是提示client与server版本不匹配,因为一个是2.15,另一个是2.12。
所以干脆把helm和client都删除,想删除干净要用这两句:
kubectl get -n kube-system secrets,sa,clusterrolebinding -o name|grep tiller|xargs kubectl -n kube-system delete
kubectl get all -n kube-system -l app=helm -o name|xargs kubectl delete -n kube-system
查看helm的版本号:
helm version
显示:主要看Client,安装tiller之后才会显示Server
2、准备tiller镜像
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.15.1
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.15.1 192.168.1.108:5000/tiller:v2.15.1
3、为tiller创建serviceaccount和clusterrolebinding
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
4、helm init
helm init -i 192.168.1.108:5000/tiller:v2.15.1
成功显示:
5、为应用程序设置serviceaccount
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
6、查看helm
kubectl get pod -n kube-system | grep tiller
helm version
helm repo list