when updating deployment with a none-exist image, Kubernetes first will start terminating the existing pod and will end up with a broken deployment. is it possible to tell kubectl to validate/pull the image before terminating existing pod?
3 Answers
2
votes
0
votes
While I have not tested this I think in theory this should work:
You can use the admission controller AlwaysPullImages
and a deployment strategy where at least one pod is up. The admission controller ensures that images are Always
pulled before the pod is started.
To enable this admission controller you will have to enable flag at Kubernetes API server like from this link:
kube-apiserver --enable-admission-plugins=AlwaysPullImages,LimitRanger
Recreate
strategy (kubernetes.io/docs/concepts/workloads/controllers/deployment/…)? Because the default isRollingUpdate
and that means (along with the probes) that only if the new pods are alive and ready, the old pods are deleted. Can you clarify this please? – Michael Hausenblas