[TOC]
原創(chuàng)文章 轉(zhuǎn)載請注明出處。
安裝helm 客戶端
方法1 手工安裝
選擇對應(yīng)的二進制文件下載厘贼,然后放到執(zhí)行kubectl 的機器上界酒。解壓,修改可執(zhí)行屬性
unzip helm.zip
chmod +x helm
mv helm /usr/local/bin
方法2 腳本安裝
$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
$ chmod 700 get_helm.sh
$ ./get_helm.sh
# 或者
$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
客戶端安裝完成
安裝 tiller server端
server 端是已deployment的形式安裝在k8s 的 kube-system namespace下的嘴秸。這里有個安全方面的坑毁欣。
添加安全相關(guān)的配置
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
將上面的內(nèi)容保存為helmsec.yml, 然后通過kubectl 創(chuàng)建對應(yīng)的service account 和 role binding
kubectl create -f helmsec.yml
使用剛剛創(chuàng)建的service account初始化服務(wù)端,詳細(xì)參數(shù)可以使用 helm init -h 查看
helm init --service-account tiller
安裝完成后看到如下信息
1.png
驗證安裝
helm version
2.png
安裝完成
可以使用helm install xxx 安裝軟件了
TROUBLE SHOOTING
-
1 Error: no available release name found
遇到這個錯誤岳掐,是由于權(quán)限問題引起的凭疮。如果沒有使用之前聲明的權(quán)限和helm 關(guān)聯(lián),就會遇到這個錯誤串述。
3.png
解決辦法
刪除對應(yīng)的 service执解,deployment, service account纲酗, role binding衰腌, 重新創(chuàng)建關(guān)聯(lián)即可
kubectl delete svc tiller-deploy -n kube-system
kubectl delete deploy tiller-deploy -n kube-system
kubectl delete -f helmsec.yml
kubectl create -f helmsec.yml
helm init --service-account tiller #注意,這里的--service-account 參數(shù)非常重要觅赊,如果少了關(guān)聯(lián)右蕊,依然會報錯。