Harbor 调用API批量创建project

网友投稿 1327 2022-09-27

Harbor 调用API批量创建project

Harbor 调用API批量创建project

Harbor创建项目的脚本

curl -u "admin:Zhu88jie" -X POST -H "Content-Type: application/json" "-d "{\"project_name\": \"test\", \"metadata\": {\"public\": \"true\"}, \"storage_limit\": -1}"

[root@k8s-master ~]# cat test1.sh #!/bin/bashurl="\coredns \csiplugin \elastic \fluent \grafana \istio \jaegertracing \jenkins \jimmidyson \joosthofman \kubeedge \kubesphere \kubespheredev \library \minio \mirrorgooglecontainers \nginxdemos \openebs \osixia \prom \thanosio \weaveworks \)for project in ${harbor_projects[@]} ; do curl -u "${user}:${passwd}" -X POST -H "Content-Type: application/json" "${url}/api/v2.0/projects" -d "{\"project_name\": \"${project}\", \"metadata\": {\"public\": \"true\"}, \"storage_limit\": -1}"; done

[root@k8s-master ~]# ./test1.sh {"errors":[{"code":"CONFLICT","message":"The project named calico already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named coredns already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named csiplugin already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named elastic already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named fluent already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named grafana already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named istio already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named jaegertracing already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named jenkins already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named jimmidyson already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named joosthofman already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named kubeedge already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named kubesphere already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named kubespheredev already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named library already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named minio already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named mirrorgooglecontainers already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named nginxdemos already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named openebs already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named osixia already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named prom already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named thanosio already exists"}]}{"errors":[{"code":"CONFLICT","message":"The project named weaveworks already exists"}]}

[root@master01 harbor]# cp harbor.yml.tmpl harbor.yamlYou have new mail in /var/spool/mail/root[root@master01 harbor]# cp harbor.yaml harbor.yaml.bakhostname: 192.168.0.8harbor_admin_password: Zhu88jiedata_volume: /data/harbor_data:/data/harbor_data./install.sh --with-chartmuseum[root@localhost ~]# vim /usr/lib/systemd/system/docker.serviceExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry=192.168.0.8[root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl restart docker 用户名admin vim /etc/docker/daemon.json[root@master02 ~]# cat /etc/docker/daemon.json{ "registry-mirrors": [ ], "insecure-registries": ["192.168.0.8"], "log-driver":"json-file", "log-opts":{"max-size":"300m", "max-file":"3"}}./offline-installation-tool.sh -l images-list.txt -d ./kubesphere-images -r 192.168.0.8[root@master1 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE192.168.0.8/kubesphere/ks-installer v3.1.1 a2516d950ca9 7 weeks ago 504MBkubesphere/ks-installer v3.1.1 a2516d950ca9 7 weeks ago 504MB192.168.0.8/kubesphere/kubectl v1.19.1 104dfef9bb9f 7 weeks ago 79.9MBkubesphere/kubectl v1.19.1 104dfef9bb9f 7 weeks ago 79.9MBkubesphere/ks-controller-manager v3.1.1 acc607b5666a 7 weeks ago 141MB192.168.0.8/kubesphere/ks-controller-manager v3.1.1 acc607b5666a 7 weeks ago 141MB

确保每台上面docker都是启动,并且可以正常拉取镜像,才能使用kk

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Ceph 普罗米修斯和granfan监控ceph
下一篇:ASM冗余详解
相关文章

 发表评论

暂时没有评论,来抢沙发吧~