Helm 常用命令及操作

Helm 常用命令

查看版本

#helm version  

查看当前安装的charts

#helm list

查询 charts

#helm search redis

安装charts

#helm install --name redis --namespaces prod bitnami/redis

查看charts状态

#helm status redis

删除charts

#helm delete --purge redis

增加repo

#helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

#helm repo add --username admin --password password myharbor https://harbor.qing.cn/chartrepo/charts

更新repo仓库资源

#helm repo update

创建charts

#helm create helm_charts

测试charts语法

#helm lint 

打包charts

#cd helm_charts && helm package ./

查看生成的yaml文件

#helm  template  helm_charts-0.1.1.tgz

更新image

#helm upgrade --set image.tag='v2019-05-09-18-48-40' study-api-en-oral myharbor/study-api-en-oral

回滚relase

#helm hist study-api-en-oral

#helm rollback 4

发布到私有harbor仓库脚本

request_url='https://harbor.qing.cn/api/chartrepo/charts/charts'
user_name='admin'
password='password'
chart_file='helm_charts-0.1.3.tgz'
curl -i -u "$user_name:$password" -k -X POST "${request_url}" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "chart=@${chart_file};type=application/x-compressed"
 
echo $result

猜你喜欢

转载自www.cnblogs.com/Qing-840/p/10846992.html