1.部署Helm客户端
[root@master01 ~]# wget https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz
[root@master01 ~]# tar zxf helm-v2.9.1-linux-amd64.tar.gz
[root@master01 ~]# mv linux-amd64/helm /usr/local/bin/
2.初始化Helm并部署Tiller服务端
[root@master01 ~]# helm init --upgrade -i \
registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.9.1 \
--stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
3.所有节点安装socat命令
[root@master01 ~]# yum install -y socat
4.验证安装是否成功
[root@master01 ~]# helm version Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
5.查看helm tiller的服务
[root@master01 ~]# kubectl get pod --all-namespaces|grep tiller kube-system tiller-deploy-98f7f7564-ppwcx 1/1 Running 0 4m
6.使用Helm部署第一个应用
6.1创建服务账号
[root@master01 ~]# kubectl create serviceaccount --namespace kube-system tiller
serviceaccount "tiller" created
6.2.创建集群的角色绑定
[root@master01 ~]# kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io "tiller-cluster-rule" created
6.3.为应用程序设置serviceAccount
[root@master01 ~]# kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
deployment.extensions "tiller-deploy" patched
6.4.搜索Helm应用
[root@master01 ~]# helm search jenkins
NAME CHART VERSION APP VERSION DESCRIPTION
stable/jenkins 0.13.5 2.73 Open source continuous integration server. It s...
[root@master01 ~]# helm repo list
NAME URL
stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
local http://127.0.0.1:8879/charts
[root@master01 ~]# helm install stable/jenkins