1、在GitHub上下载需要的二进制文件,我这里使用的版本是2.14.1
# wget https://get.helm.sh/helm-v2.14.1-linux-amd64.tar.gz
# tar xf helm-v2.14.1-linux-amd64.tar.gz
# cp linux-amd64/helm /usr/local/bin/
然后helm 客户端就安装成功了。
2、初始化操作
# helm init
3、查看Pod
Helm 服务端正常安装完成后,Tiller默认被部署在kubernetes集群的kube-system命名空间下:
# kubectl get pod -n kube-system -l app=helm
NAME READY STATUS RESTARTS AGE
tiller-deploy-54db94578d-72mh9 1/1 Running 0 52m
然后就可以正常查看版本了:
# helm version
Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
4、给tiller添加权限
创建ServiceAccount,配置ClusterRoleBinding.
rbac.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 apply -f rbac.yaml
创建了tiller的 ServceAccount 后还没完,因为我们的 Tiller 之前已经就部署成功了,而且是没有指定 ServiceAccount 的,所以我们需要给 Tiller 打上一个 ServiceAccount 的补丁:
$ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'