官方安装文档
https://github.com/kubernetes/helm/blob/master/docs/install.md
安装 helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod +x get_helm.sh
./get_helm.sh
制作k8s service_account
官方文档: https://github.com/kubernetes/helm/blob/master/docs/rbac.md
编写 helm_rbac-config.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 helm_rbac-config.yaml
安装 tiller
执行脚本
helm init --service-account=tiller --stable-repo-url=http://kubernetes-charts.storage.googleapis.com
成功会显示:
Creating /root/.helm/repository/repositories.yaml Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com Adding local repo with URL: http://127.0.0.1:8879/charts $HELM_HOME has been configured at /root/.helm. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster. Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy. For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation Happy Helming!
更新 repo
helm repo update sed -i 's/https/http/g' ~/.helm/repository/cache/stable-index.yaml
验证 helm 安装是否成功
helm version
正常会显示:
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
验证 repo 是否正常
helm search redis
正常会显示:
NAME CHART VERSION APP VERSION DESCRIPTION stable/prometheus-redis-exporter 0.2.0 0.16.0 Prometheus exporter for Redis metrics stable/redis 3.6.0 4.0.10 Open source, advanced key-value store. It is of... stable/redis-ha 2.1.3 4.0.8-r0 Highly available Redis cluster with multiple se... stable/sensu 0.2.3 0.28 Sensu monitoring framework backed by the Redis ...
以上