harbor管理helm-charts

版本信息

harbor version: 1.8.1
helm version: v3.6.2
docker version: 18.06.3
docker-compose version: 1.25.4

安装chartmuseum插件

harbor 安装的时候 默认没有helm charts的仓库

docker-compose stop
./install.sh  --with-chartmuseum

安装完成之后登录页面上就会有了 helm charts 了,页面上也可以直接上传charts

helm 安装push插件

# 安装插件
helm plugin install https://github.com/chartmuseum/helm-push

# 查看
[root@k8s-master ~]# helm plugin list
NAME   	VERSION	DESCRIPTION                      
cm-push	0.10.1 	Push chart package to ChartMuseum

创建一个charts项目

添加仓库

helm repo add harbor https://harbor.xxx.com/chartrepo/library

# 如需要配置用户名密码
helm repo add harbor --username=xxx --password=xxx https://harbor.xxx.com/chartrepo/library

查看

[root@k8s-master ~]# helm repo list
NAME         	URL                                       
bitnami      	https://charts.bitnami.com/bitnami        
ingress-nginx	https://kubernetes.github.io/ingress-nginx
harbor       	http://harbor.aimm.cn/chartrepo/library   

上传到仓库

# 查找charts
[root@k8s-master ~]# helm search repo redis
NAME                 	CHART VERSION	APP VERSION	DESCRIPTION                                       
bitnami/redis        	15.0.4       	6.2.5      	Open source, advanced key-value store. It is of...
bitnami/redis-cluster	6.3.6        	6.2.5      	Open source, advanced key-value store. It is of...

# 下载到本地
[root@k8s-master ~]# helm pull bitnami/redis
[root@k8s-master ~]# ls redis-15.0.4.tgz 
redis-15.0.4.tgz

# 上传到私有仓库
[root@k8s-master ~]# helm cm-push --username=admin --password=Harbor12345 redis-15.0.4.tgz harbor 
Pushing redis-15.0.4.tgz to harbor...
Done.

上传完成后到harbor仓库查看

强制推送

[root@k8s-master ~]# helm cm-push --force redis-15.0.4.tgz harbor 
Pushing redis-15.0.4.tgz to harbor...
Done.

直接推送到URL

[root@k8s-master ~]# helm cm-push redis-15.0.4.tgz https://harbor.xxx.com/chartrepo/library
Pushing redis-15.0.4.tgz to https://harbor.xxx.com/chartrepo/library
Done.

报错解决:

[root@k8s-master ~]# helm cm-push redis-15.0.4.tgz harbor
Pushing redis-15.0.4.tgz to harbor...
Error: 401: could not properly parse response JSON: {"code":401,"message":"Unauthorized"}
......
Error: plugin "cm-push" exited with error

添加用户名密码即可。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值