k8s集群节点共用私有仓库,要有验证。
kbs01 master 192.168.226.10
kbs02 node01 192.168.226.20
kbs03 node02 192.168.226.30
[root@kbs01 ~]# docker run -itd --name registory --restart=always -p 5000:5000 registry
1461518b6484480b63ffc7249e3746ad4d079ca99073d6ca3738ea92752bc664
[root@kbs01 ~]# vim /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd -H unix:// --insecure-registry 192.168.226.10:5000
[root@kbs01 ~]# systemctl daemon-reload
[root@kbs01 ~]# systemctl restart docker
节点连接私有库:
[root@kbs02 ~]# vim /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd -H unix:// --insecure-registry 192.168.226.10:5000
[root@kbs02 ~]# systemctl daemon-reload
[root@kbs02 ~]# systemctl restart docker
[root@kbs03 ~]# vim /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd -H unix:// --insecure-registry 192.168.226.10:5000[
root@kbs03 ~]# systemctl daemon-reload
[root@kbs03 ~]# systemctl restart docker
上传下载私有镜像验证:
[root@kbs01 ~]# docker push 192.168.226.10:5000/nginx
The push refers to repository [192.168.226.10:5000/nginx]6ac0e4107e5a: Pushed 12fdf55172df: Pushed 002a63507c1c: Pushed 1c95c77433e8: Pushed latest: digest: sha256:0d1ad5bf95fe2e855d6592370e0c2e051c4ba53eb7f9852378fb778c283f10a9 size: 1155
[root@kbs02 ~]# docker pull 192.168.226.10:5000/nginxUsing default tag: latestlatest: Pulling from nginx1ab2bdfe9778: Pull complete a17e64cfe253: Pull complete e1288088c7a8: Pull complete 17e968cd67d6: Pull complete Digest: sha256:0d1ad5bf95fe2e855d6592370e0c2e051c4ba53eb7f9852378fb778c283f10a9Status: Downloaded newer image for 192.168.226.10:5000/nginx:latest
docker的registory私有库
最新推荐文章于 2024-02-04 14:33:13 发布