安装 Helm

    执行脚本安装 helm 客户端:

    查看客户端版本:

    1. Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
    1. $ helm init
    2. Creating /root/.helm
    3. Creating /root/.helm/repository
    4. Creating /root/.helm/repository/cache
    5. Creating /root/.helm/repository/local
    6. Creating /root/.helm/plugins
    7. Creating /root/.helm/starters
    8. Creating /root/.helm/cache/archive
    9. Creating /root/.helm/repository/repositories.yaml
    10. Adding local repo with URL: http://127.0.0.1:8879/charts
    11. $HELM_HOME has been configured at /root/.helm.
    12. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
    13. Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
    14. For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
    15. Happy Helming!

    查看 tiller 是否启动成功:

    如果状态是 ImagePullBackOff ,说明是镜像问题,一般是未拉取到镜像(国内机器拉取不到 gcr.io 下的镜像) 可以查看下是什么镜像:

    1. $ kubectl describe pod tiller-deploy-dccdb6fd9-2df4r --namespace=kube-system
    2. Events:
    3. Type Reason Age From Message
    4. ---- ------ ---- ---- -------
    5. Warning Failed 36m (x5 over 12h) kubelet, k8s-node1 Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.9.1": rpc error: code = Unknown desc = Get https://gcr.io/v1/_ping: dial tcp 64.233.189.82:443: i/o timeout
    6. Warning Failed 6m (x3237 over 14h) kubelet, k8s-node1 Error: ImagePullBackOff
    7. Warning Failed 1m (x15 over 14h) kubelet, k8s-node1 Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.9.1": rpc error: code = Unknown desc = Get https://gcr.io/v1/_ping: dial tcp 64.233.188.82:443: i/o timeout
    1. $ kubectl get pods -n kube-system | grep tiller
    2. tiller-deploy-dccdb6fd9-2df4r 1/1 Running 1 41d

    默认安装的 tiller 权限很小,我们执行下面的脚本给它加最大权限,这样方便我们可以用 helm 部署应用到任意 namespace 下:

    更多参考官方文档: https://helm.sh/docs/using_helm/#quickstart-guide

    安装 Helm V3

    1. $ wget https://get.helm.sh/helm-v3.0.0-beta.3-linux-amd64.tar.gz

    解压并移动到 PATH 下面:

    1. $ tar -zxvf helm-v3.0.0-beta.3-linux-amd64.tar.gz
    2. linux-amd64/
    3. linux-amd64/LICENSE
    4. linux-amd64/helm
    5. linux-amd64/README.md
    6. $ cd linux-amd64/
    7. $ ls