• harbor管理helmcharts


    版本信息

    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
    

    添加用户名密码即可。

  • 相关阅读:
    MapReduce Design Patterns(4. 分层,分区)(七)
    MapReduce Design Patterns(3. Top Ten))(六)
    MapReduce Design Patterns(3. Top Ten))(六)
    树的子结构-剑指Offer
    合并两个排序的链表-剑指Offer
    反转链表-剑指Offer
    链表中倒数第k个结点-剑指Offer
    数值的整数次方-剑指Offer
    二进制中1的个数-剑指Offer
    变态跳台阶-剑指Offer
  • 原文地址:https://www.cnblogs.com/heyongboke/p/15838528.html
Copyright © 2020-2023  润新知