使用nginx搭建helm私有仓库

  • Post author:
  • Post category:其他


#使用nginx 起一个helm的http服务
[root@master1 ~]# docker run -d --name=nginx -p 81:80  -v /root/charts:/usr/share/nginx/html/charts nginx

#把本地的helm-chart打包并上传私有仓库
[root@master1 ~]# helm package rabbitmq
[root@master1 ~]# helm package mysql/bitnami-mysql/mysql
[root@master1 ~]# mv ./*.tgz /root/charts
#更新index.yaml
[root@master1 ~]# helm repo index /root/charts --url http://10.15.123.93:81/charts #该操作会在/root/charts/目录生成index.yaml文件,该文件包含了helm库应用信息
[root@master1 ~]# ls /root/charts/  #查看是否生成

#添加helm私有仓库到本地
[root@master1 ~]# helm repo add myrepo http://10.15.123.93:81/charts
#验证
[root@master1 ~]# helm repo ls
[root@master1 ~]# helm search repo myrepo

#安装、卸载
[root@master1 ~]# helm install mysql myrepo/mysql -n mysql --create-namespace
[root@master1 ~]# helm ls -n mysql
[root@master1 ~]# helm uninstall mysql -n mysql


#其他常用操作:
#创建testechart
[root@master1 ~]# helm create testchart  
#删除本地仓库
[root@master1 ~]# helm repo remove myrepo

#更新发布:打包上传重新生成index文件后,执行更新仓库及更新mysql操作
[root@master1 ~]# helm package mysql/bitnami-mysql/mysql
[root@master1 ~]# mv ./mysql-9.3.3.tgz /root/charts
[root@master1 ~]# helm repo index /root/charts --url http://10.15.123.93:81/charts
[root@master1 ~]# helm repo update 
[root@master1 ~]# helm upgrade mysql myrepo/mysql -n mysql --create-namespace

参考:

https://blog.csdn.net/u011127242/article/details/118197361



版权声明:本文为weixin_44515412原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。