安裝 helm tiller monocular

部分內容參考 https://blog.csdn.net/bbwangj/article/details/81087911

 

下載helm

https://get.helm.sh/helm-v2.14.1-linux-amd64.tar.gz

 

上傳至 centos 虛擬機 解壓

mv helm-v2.14.1-linux-amd64.tar.gz

移動至bin目錄

 

mv linux-amd64/helm /usr/local/bin/helm

 

helm 命令可用  刪除線忽略,參考後面的安裝方式

換helm鏡像到阿里雲

helm init --client-only --stable-repo-url https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts/
helm repo add incubator https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/
helm repo update

安裝Tiller

helm init


查看

kubectl get pods -n kube-system|grep tiller

 

卸載使用 helm reset

查詢  charts

helm search

 

更換倉庫

# 先移除原先的倉庫
helm repo remove stable
# 添加新的倉庫地址
helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
# 更新倉庫
helm repo update


helm init --client-only --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo add incubator https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/
helm repo update

使用下面的命令提醒不接受參數

# 創建服務端 下面的命令失敗了
helm init --service-account tiller --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.14.1  --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

準備使用docker直接安裝的時候再次嘗試了一下, 去掉了 --upgrade, 居然安裝成功

helm init --service-account tiller -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.14.1 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

重要的一步, 給tiller授權 , 第一次安裝的時候是按最上面的教程來的,所以一切很順利,也沒有記錄授權這塊內容, 但是當重新回來重新安裝的時候,少了這一步,導致容器組創建失敗

報錯

"conditions": [
      {
        "type": "ReplicaFailure",
        "status": "True",
        "lastTransitionTime": "2019-06-26T08:07:25Z",
        "reason": "FailedCreate",
        "message": "pods \"tiller-deploy-767d9fb945-\" is forbidden: error looking up service account kube-system/tiller: serviceaccount \"tiller\" not found"
      }
    ]

 

授權命令

kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

給tiller設置賬號

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

檢查是否授權成功
kubectl get deploy --namespace kube-system   tiller-deploy  --output yaml|grep  serviceAccount

授權完成後, tiller就可以使用了.

單獨安裝tiller

helm init --service-account tiller --upgrade -i 192.168.106.55:8081/google_containers/tiller:v2.14.1

暴露服務

kubectl expose deployment tiller-deploy -n kube-system --port=44134 --target-port=44134 --external-ip=192.168.106.56

 

安裝 nginx  注意 true後面的逗號不能寫錯

helm install stable/nginx-ingress --set controller.hostNetwork=true,rbac.create=true

nginx-ingress-controller 一直處理pending狀態 但是不影響使用

curl http://192.168.220.129:32526/healthz 獲取200的響應, 其它請求獲取 404

這說明安裝成功了

 

安裝  monocular 

helm repo add monocular https://helm.github.io/monocular
helm install --name monocular monocular/monocular

安裝後一直不知道怎麼使用, 接着搞

主要是不理解nginx-ingress 與 monocular如何對接的, 另外 nginx-ingress-controller 一直處理pending狀態 

還需要仔細理解一下

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章