We need to scale up pods in our AKS Cluster.
Somethimes we need to spin up so much, that multiple extra nodes are needed.
Our docker image is 20GB big to pull.
(Yes I know its way to big, but it's impossible to reduce the size due being an older application.)
But I'm wondering if we spin up 5 new pods on 1 new node, do they all 5 start pulling the 20GB image at startup? Due the image is not cached.
If they do, is there a way to prevent this?
I prefer to have 4 pods waiting for pod 1 to download the image then downloading it 5 times.
CodePudding user response:
But I'm wondering if we spin up 5 new pods on 1 new node, do they all 5 start pulling the 20GB image at startup? Due the image is not cached.
image being cache on Node they won't start maybe pulling the image each time.
If they do, is there a way to prevent this?
if you don't want to cache and each time want to pull image you can use the imagepullpolicy : always
in your YAML config.
If you want to make it quicker you can run 1 pod first and scale pods after that using command or HPA
CodePudding user response:
Images are cached on the node to speedup new created pods on the same node.
A very simple way to prevent that would be starting one pod per node at first and then scaling it up so the container runtime can reuse the previously pulled image.