接前一篇《CICD搭建之 kubernetes-dashboard》,驗證一下從registry拉取鏡像部署應(yīng)用铁瞒。
還是用nginx進行部署绊起,先重命名
[root@localhost tmp]# docker tag nginx:latest localhost:7501/nginx
推送到私服,并查看一下本地鏡像
[root@localhost tmp]# docker push localhost:7501/nginx
The push refers to repository [localhost:7501/nginx]
8032102adebe: Pushed
8eb80f066de2: Pushed
7230cfe05cc1: Pushed
822ae9fef1d8: Pushed
07cab4339852: Mounted from redis
latest: digest: sha256:416d511ffa63777489af47f250b70d1570e428b67666567085f2bece3571ad83 size: 1362
[root@localhost tmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 992e3b7be046 2 days ago 133MB
localhost:7501/nginx latest 992e3b7be046 2 days ago 133MB
jenkinsci/blueocean 1.24.0 8bc6e31b0d6a 6 days ago 755MB
刪除本地鏡像
[root@localhost tmp]# docker rmi localhost:7501/nginx
Untagged: localhost:7501/nginx:latest
Untagged: localhost:7501/nginx@sha256:416d511ffa63777489af47f250b70d1570e428b67666567085f2bece3571ad83
[root@localhost tmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 992e3b7be046 2 days ago 133MB
jenkinsci/blueocean 1.24.0 8bc6e31b0d6a 6 days ago 755MB
修改部署配置,如下圖笋鄙,修改為我們私服的鏡像名萧落。
點擊更新,pod會進行滾動更新陨倡。
如圖1和2许布,查看pod,選擇其中一個點擊如下圖杂曲,可以看到更新日志袁余,拉取的鏡像為"localhost:7501/nginx"
訪問正常