helm重要操作记录
文章目录
【注意】最后更新于 January 14, 2020,文中内容可能已过时,请谨慎使用。
helm tiller安装
helm init
helm init –tiller-image=daocloud.io/liukuan73/tiller-lk:v2.9.1 –tiller-namespace=kube-system
helm init –upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.5.1 –stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm init –tiller-image=harbor.hub.cn/bigdata-dev/tiller:v2.10.0 –tiller-namespace=kube-system –stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
|
|
删除helm服务
helm reset
helm reset -f //强制删除k8s集群上的pod
repo 查询、服务、添加
helm repo list
helm serve –address 0.0.0.0:8879 –repo-path /dcos/appstore/local-repo
|
|
helm repo add local-repo http://10.128.2.2:8879
helm repo add helm-remote http://10.128.22.33:8081/artifactory/helm-remote –username –password
helm repo add harbor –cert-file=/root/kye/harbor.crt –key-file=/root/kye/harbor.key –ca-file=/etc/docker/certs.d/harbor.cn/ca.crt –username=*** –password=*** https://harbor.cn/chartrepo/helm
helm repo add –username=*** –password=***** cmdb https://harbor.hub.cn/chartrepo/cmdb
更新index.yaml文件
helm repo index –url=http://10.142.21.21:8879 .
helm repo update
|
|
向repo中增加软件包(将chart文件夹移动到repo目录,并将chart打包)
helm package jenkins –save=false
helm package k8sapi –version 1.0.3
helm package middlewares –version=1.5.0 -u middlewares/Chart.yaml
|
|
验证/搜索
helm search jenkins
安装Chart
helm install local-repo/jenkins //指定local-repo:
helm install stable/mariadb //指定chart:
helm install ./nginx-1.2.3.tgz //指定打包的chart:
helm install ./nginx //指定打包目录:
helm install https://example.com/charts/nginx-1.2.3.tgz //指定chart包URL:
helm install -f myvalues.yaml ./redis //如果要覆盖chart中的默认值,通过指定配置文件方式
helm install stable/mysql –name mysqlyo //指定部署name fullname
创建charts
helm create mycharts
查询chart部署
helm get my-release
查看状态
helm status my-release
查看全部的release
helm list -a
更新版本
helm upgrade my-release -f mysql/values.yaml –set resources.requests.memory=1024Mi my-release
helm upgrade unsung-sparrow local/k8sapi –version 1.0.0
查看本地Chart生成yaml文件
helm template .
版本回滚
helm rollback mysql 1 //1为版本号,可以添加 –debug打印调试信息
helm rollback –debug mysql 1
|
|
查看release的版本信息
helm hist my-release
删除release
helm delete my-release //可回滚
helm ls -a myrelease //确认是否删除
helm delete –purge my-release //彻底删除 不可回滚
使用第三方chat库
helm repo add fabric8 https://fabric8.io/helm //添加fabric8库
helm search fabric8 //搜索fabric8提供的工具
使用 upgrade ,会自动判读如果没安装,会先安装(建议使用此方法)
helm upgrade –install mycharts .
helm upgrade –install –set name=mycharts –tiller-namespace=default mycharts ./mycharts/
下载charts到本地
helm search peometheus
helm fetch stable/prometheus
helm fetch stable/mysql –version 0.2.8 –untar
利用helm lint命令检查下载的chart是否存在问题
helm lint mysql
上传 Helm Charts
https://aeric.io/post/harbor-manage-helm-charts/
插件Plugin
helm plugin install https://github.com/chartmuseum/helm-push
push操作
helm push –ca-file=ca.crt –key-file=server.key –cert-file=server.crt –username=admin –password=passw0rd chart_repo/hello-helm-0.1.0.tgz myrepo
helm push k9sapi harbor –version 0.0.1
helm chart顺序启动或依赖启动
|
|
各种名词变量解析
|
|
文章作者 lxp
上次更新 2020-01-14 (a81e1eb)