每次将图片推送到GCR时自动更新广告连播

编程入门 行业动态 更新时间:2024-10-25 00:31:03
本文介绍了每次将图片推送到GCR时自动更新广告连播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个用docker push gcr.io/go-demo/servertime推送到Container Registry的docker映像,和一个用kubectl run servertime --image=gcr.io/go-demo-144214/servertime --port=8080创建的pod.

I have a docker image pushed to Container Registry with docker push gcr.io/go-demo/servertime and a pod created with kubectl run servertime --image=gcr.io/go-demo-144214/servertime --port=8080.

每当我推送图像的新版本时,如何启用pod的自动更新?

How can I enable automatic update of the pod everytime I push a new version of the image?

推荐答案

我建议切换到某种CI来管理进程,而不是在docker push上触发,而在将提交推送到git仓库时触发该进程.同样,如果您切换到使用更高级别的kubernetes构造(例如deployment),则可以将Pod滚动更新到新的图像版本.我们的过程大致如下:

I would suggest switching to some kind of CI to manage the process, and instead of triggering on docker push triggering the process on pushing the commit to git repository. Also if you switch to using a higher level kubernetes construct such as deployment, you will be able to run a rolling-update of your pods to your new image version. Our process is roughly as follows :

git commit #triggers CI build docker build yourimage:gitsha1 docker push yourimage:gitsha1 sed -i 's/{{TAG}}/gitsha1/g' deployment.yml kubectl apply -f deployment.yml

deployment.yml是用于我们的部署的模板,该模板将更新为新的标记版本.

Where deployment.yml is a template for our deployment that will be updated to new tag version.

如果您手动执行此操作,则可以通过运行kubectl set image deployment/yourdeployment <containernameinpod>=yourimage:gitsha1

If you do it manually, it might be easier to simply update image in an existing deployment by running kubectl set image deployment/yourdeployment <containernameinpod>=yourimage:gitsha1

更多推荐

每次将图片推送到GCR时自动更新广告连播

本文发布于:2023-10-22 22:27:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518913.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自动更新   广告   图片   GCR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!