问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
