大网数据广告活动
服务器运维问答

k8s ignores new images with the same tag

· 52CE 我爱测

I have a k8s deployment (using helm) that should grab an image from a repo. if I specify the image with exact tag - it will be taken by the k8s. recently - in order not to change the code I've changed the image name to xxx/myserv…

问题原文

原帖链接 · Dani · CC BY-SA 4.0

I have a k8s deployment (using helm) that should grab an image from a repo. if I specify the image with exact tag - it will be taken by the k8s. recently - in order not to change the code I've changed the image name to xxx/myserver:latest.

I'm pushing the latest tag to the repo each time I've updating the image: so xxx/myserver:v11 -- >xxx.myserver:latest and then v12 arrives I'm pointing the latest tag to it.

my problem is that once k8s grabbed the latest version (for v11) it will not grab it again and it keeps building the old container.

已采纳解答

原帖链接 · Sam Cogan · CC BY-SA 4.0

You need to update your image pull policy on your deployment. By default it will only pull images from the repo if the same version is not present in the cluster. As you are using the latest tag, then the Kubernetes does not know that the image has been updated. You need to force it to pull every time using the ImagpullPolicy of Always.

Using "latest" is generally a bad idea in production, as you will not know what version of an image each of your pods is running.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。