1、在GitHub上下载需要的二进制文件,我这里使用的版本是2.14.1

    1. # wget https://get.helm.sh/helm-v2.14.1-linux-amd64.tar.gz
    2. # tar xf helm-v2.14.1-linux-amd64.tar.gz
    3. # cp linux-amd64/helm /usr/local/bin/

    然后helm 客户端就安装成功了。

    2、初始化操作

    1. # helm init

    3、查看Pod
    Helm 服务端正常安装完成后,Tiller默认被部署在kubernetes集群的kube-system命名空间下:

    1. # kubectl get pod -n kube-system -l app=helm
    2. NAME READY STATUS RESTARTS AGE
    3. tiller-deploy-54db94578d-72mh9 1/1 Running 0 52m

    然后就可以正常查看版本了:

    1. # helm version
    2. Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}
    3. Server: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}

    4、给tiller添加权限
    创建ServiceAccount,配置ClusterRoleBinding.
    rbac.yaml

    1. apiVersion: v1
    2. kind: ServiceAccount
    3. metadata:
    4. name: tiller
    5. namespace: kube-system
    6. ---
    7. apiVersion: rbac.authorization.k8s.io/v1beta1
    8. kind: ClusterRoleBinding
    9. metadata:
    10. name: tiller
    11. roleRef:
    12. apiGroup: rbac.authorization.k8s.io
    13. kind: ClusterRole
    14. name: cluster-admin
    15. subjects:
    16. - kind: ServiceAccount
    17. name: tiller
    18. namespace: kube-system

    然后创建:

    1. # kubectl apply -f rbac.yaml

    创建了tiller的 ServceAccount 后还没完,因为我们的 Tiller 之前已经就部署成功了,而且是没有指定 ServiceAccount 的,所以我们需要给 Tiller 打上一个 ServiceAccount 的补丁:

    1. $ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'