helm安装及使用

Posted xuliang666

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 [[email protected] ~]# helm init --service-account tiller #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 [[email protected] 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 [[email protected] linux-amd64]# 验证: [[email protected] ~]# helm version Client: &version.VersionSemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean" Server: &version.VersionSemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean" [[email protected] ~]#

 

helm安装gitlab插件

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

 

 

 

[[email protected] ~]# helm plugin install https://github.com/technosophos/helm-template
[[email protected] ~]# helm plugin install helm-git
Installed plugin: helm-git
[[email protected] ~]# 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. 
[[email protected] ~]#
[[email protected] helm-git]# helm repo list
NAME  	URL                                                 
stable	https://kubernetes-charts.storage.googleapis.com    
local 	http://127.0.0.1:8879/charts                        
jiatui	gitlab://devops/service-config-k8s:master/helm-jtsys
[[email protected] helm-git]# 

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

 

添加helm仓库

[[email protected] ~]# helm repo list
NAME  	URL                                             
stable	https://kubernetes-charts.storage.googleapis.com
local 	http://127.0.0.1:8879/charts                    
[[email protected] ~]# helm repo add jiatui gitlab://devops/service-config-k8s:master/helm-jtsys
Username for ‘https://arch-git.jiatuiyun.net‘: root
Password for ‘https://[email protected]‘: 
"jiatui" has been added to your repositories
[[email protected] ~]# helm repo list
NAME  	URL                                                 
stable	https://kubernetes-charts.storage.googleapis.com    
local 	http://127.0.0.1:8879/charts                        
jiatui	gitlab://devops/service-config-k8s:master/helm-jtsys
[[email protected] ~]# 

  

安装应用 

安装:
helm install --name company jiatui/jtsys --debug --dry-run -f service-config-k8s/values.yaml/test-company-value.yaml

更新:
helm upgrade architect jiatui/jtsys --debug  -f  service-config-k8s/values.yaml/test-company-value.yaml
动态扩展
kubectl  get deploy -n company --no-headers | awk ‘cmd="sleep 10;kubectl  -n company scale --replicas=0 deploy/"$1;system(cmd)‘

  

 

  

 




以上是关于helm安装及使用的主要内容,如果未能解决你的问题,请参考以下文章

Helm3安装及使用

helm下载及使用

helm下载及使用

关于Kubernetes中使用Helm部署应用及私有Helm源搭建的一些笔记

关于Kubernetes中使用Helm部署应用及私有Helm源搭建的一些笔记

Helm安装及配置