k8s documentation about IfNotPresent
image pull policy states:
the image is pulled only if it is not already present locally.
I'm not sure what "locally" actually means. Does it mean "locally in a k8s cluster" or "locally on a node where pod is created"? If I have 2 pods with same images but different image pull policies, does pulling the image for the 1st pod affects another pod?
CodePudding user response:
it simply mean the : locally on worker nodes on which POD runs
If I have 2 pods with same images but different image pull policies, does pulling the image for the 1st pod affects another pod?
If it's the same image there won't be any issue in running either it gets pulled again or so, data will be the same each time.
However, the policy will work for each deployment separately so if it's always, it will pull images all time for that specific deployment.
If it's present in node locally with a similar TAG mentioned in YAML, policy set IfNotPresent local one will be used as TAG and URI matching and image is already available as it will use that.
CodePudding user response:
This means that it checks if the image is present in the node where the pod is scheduled if its present then it will use the existing image.
But if the image:tag
is not present in the node then the worker node where pod is scheduled will pull the docker image and store it locally. Also please note Kubernetes itself doesn't pull anything. Images are downloaded via container runtime(e.g Docker)