helm安裝及使用


helm簡介

官網文檔:https://helm.sh/

helm是kubernetes的包管理器,類似於linux系統下的apt-get或yum

安裝

wget https://get.helm.sh/helm-v2.12.3-linux-amd64.tar.gz
cp helm tiller /usr/local/bin helm version tiller -version 安裝初始化: kubectl apply -f install/kubernetes/helm/helm-service-account.yaml [root@k8s-master ~]# helm init --service-account tiller  --skip-refresh #helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts 查看 #kubectl get pod -n kube-system -l app=helm [root@k8s-master linux-amd64]# kubectl get pod -n kube-system -l app=helm NAME READY STATUS RESTARTS AGE tiller-deploy-7df745645f-ptzwj 1/1 Running 0 5m22s [root@k8s-master linux-amd64]# 驗證: [root@k8s-master ~]# helm version Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"} [root@k8s-master ~]#

 

helm安裝gitlab插件

插件地址:https://github.com/diwakar-s-maurya/helm-git 

用戶根據公司業務需求,制作適用於自己的helm模板

[root@k8s-master ~]# helm plugin install https://github.com/technosophos/helm-template
[root@k8s-master ~]# helm plugin install helm-git
Installed plugin: helm-git
[root@k8s-master ~]# helm plugin list
NAME VERSION	DESCRIPTION 
helm-git	1.0.0 Let's you use private gitlab repositories easily
template	2.5.1+2	Render templates on the local client. 
[root@k8s-master ~]#
[root@k8s-node1 helm-git]# helm repo list
NAME  	URL                                                 
stable	https://kubernetes-charts.storage.googleapis.com    
local 	http://127.0.0.1:8879/charts                        
[root@k8s-node1 helm-git]# 

 helm plugin remove helm-git
 helm plugin install helm-git
 

添加helm倉庫

[root@k8s-master ~]# helm repo list
NAME  	URL                                             
stable	https://kubernetes-charts.storage.googleapis.com
local 	http://127.0.0.1:8879/charts                    
[root@k8s-master ~]# helm repo add bigdata gitlab://xx:master/helm-jtsys
[root@k8s-master ~]# helm repo list
NAME  	URL                                                 
stable	https://kubernetes-charts.storage.googleapis.com    
local 	http://127.0.0.1:8879/charts                        

[root@k8s-master ~]# 

  

安裝應用 

 

安裝:
helm install --name bigdata bigdata/jtsys --debug --dry-run -f test-bigdata-value.yaml

更新:
helm upgrade bigdata bigdata/jtsys --debug  -f  test-bigdata-value.yaml
動態擴展
kubectl  get deploy -n bigdata --no-headers | awk '{cmd="sleep 10;kubectl  -n company scale --replicas=0 deploy/"$1;system(cmd)}'

  

helm模板

未完...... 

  

 





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM