How Kubernetes Pulls Image from outer respository? Where is the image stored?

10/5/2018

I want to understand better how Kubernetes works,and there are some doubts I haven't founded answer in documentation.

I have a simple Kubernetes Cluster, a Master, and 2 Workers. I have created a docker image of my app which is stores in dockerhub.

I created a deployment_file.yaml, where I state that I want to deploy my app container in worker 3, thanks to node affinity.

If imagePullPolicy set to Always

  • Who is downloading the image from dockerhub, the master itself, or is it the worker were this image will be deployed??? If it is the master who pulls the image, then it transfer replicas of this images to the workers?

  • When a the image is pulled, is it stored in any local folder in kubernetes?

I would like to understand better how data is transferred. Thanks.

-- Claira
docker
dockerhub
image
kubernetes
pull

2 Answers

10/10/2018

Who is downloading the image from dockerhub?

The Kubernetes itself doesn't pull anything. Images are downloading via runtime'a client, e.g Docker

When a the image is pulled, is it stored in any local folder in kubernetes?

Again, it is the runtime's task. Depending on the runtime and its configuration it might be different. In case of Docker it will be like it described in @Praveen Sripati's link

-- Konstantin Vustin
Source: StackOverflow

10/5/2018

Each of the minions (workers) will pull the docker image and store it locally. docker image ls will show the list of image on the minions.

To address where are the images are stored. Take a look at SO answer here.

-- Praveen Sripati
Source: StackOverflow