• image-syncer


    1、配置文件

    {
        "auth": {
            "10.1.11.46": {
                "username": "admin",
                "password": "Harbor12345",
                "insecure": true
            }
        },
        "images": {
            "10.10.101.176:8443/k8s-deploy/ceph": "10.1.11.46/ceph/ceph",
    "10.10.101.176:8443/k8s-deploy/test": "10.1.11.46/ceph/test"
        }
    }

    auth配置harbor账号密码

    images配置同步规则,前面是源 后面是目的,上面例子就是把10.10.101.176:8443/k8s-deploy/ceph 库同步到10.1.11.46/ceph/ceph下

    注意:如果要同步整个registry,需要在images里写多条规则

    2、开始同步

    [root@10 DTR]# ./image-syncer --proc=10 --config=./harbor.json --retries=1
    
    
    Start to generate sync tasks, please wait ...
    INFO[2020-12-01 15:21:59] Cannot find auth information for 10.10.101.176:8443/k8s-deploy/ceph, pull actions will be anonymous 
    INFO[2020-12-01 15:21:59] Get tags of 10.10.101.176:8443/k8s-deploy/ceph successfully: [v1.4.7] 
    INFO[2020-12-01 15:21:59] Cannot find auth information for 10.10.101.176:8443/k8s-deploy/ceph:v1.4.7, pull actions will be anonymous 
    INFO[2020-12-01 15:22:00] Find auth information for 10.1.11.46/ceph/ceph:v1.4.7, username: admin 
    INFO[2020-12-01 15:22:00] Generate a task for 10.10.101.176:8443/k8s-deploy/ceph:v1.4.7 to 10.1.11.46/ceph/ceph:v1.4.7 
    Start to handle sync tasks, please wait ...
    INFO[2020-12-01 15:22:00] Get manifest from 10.10.101.176:8443/k8s-deploy/ceph:v1.4.7 
    INFO[2020-12-01 15:22:01] Blob sha256:6910e5a164f725142d77994b247ba20040477fbab49a721bdbe8d61cf855ac23(74866818) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:01] Blob sha256:90161ff7470d7d629165d4a3deb6c30d6b4f62e283bd4a2b2003a6668bcda00d(247930394) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:02] Blob sha256:b7e416a8a537d1e2b47e2597cd25bdf5e2704444ccbace664dcbe4d4693d0b46(9466) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:02] Blob sha256:c1999958c190bb7fd4a0914255ec9f67aff57325bdd685e3450e50cab5a3232b(26601597) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:03] Blob sha256:d070b06a8225df541071c712adf96632262bbd74073029177746bfb4082242dd(2739) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:03] Blob sha256:c6d9c23d887f4c0413ec816ffa9e886451b083304674e86a0184e60c46859ddc(3658) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:04] Blob sha256:6d27aeef3339d1bc806cd74a00ea0115d773f050f41334b11d60fcc4a809a4a2(56170) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:04] Blob sha256:6433f073612174d8abca66ec3ff3dc0f3c662cff4522cd7190be786e368f2ccf(14215) has been pushed to 10.1.11.46/ceph/ceph, will not be pulled 
    INFO[2020-12-01 15:22:05] Put manifest to 10.1.11.46/ceph/ceph:v1.4.7  
    INFO[2020-12-01 15:22:05] Synchronization successfully from 10.10.101.176:8443/k8s-deploy/ceph:v1.4.7 to 10.1.11.46/ceph/ceph:v1.4.7 
    Finished, 0 sync tasks failed, 0 tasks generate failed
    INFO[2020-12-01 15:22:05] Finished, 0 sync tasks failed, 0 tasks generate failed

    3、查看结果

    curl https://10.1.11.46/api/search?q=ceph -k | grep ceph

  • 相关阅读:
    Kubernetes之Replica Set
    Kubernetes之Replication Controller
    Kubernetes之Deployment
    golang channel select
    golang slice
    epoll的由来
    ceph crush 之 crush_do_rule
    libevent
    P2P资料
    混沌理论学习笔记
  • 原文地址:https://www.cnblogs.com/zphqq/p/14068649.html
Copyright © 2020-2023  润新知