7

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
  • 73
  • 1
  • 3

2 Answers2

6

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
  • 32,799
  • 16
  • 80
  • 117
  • Thanks for your answer. So each worker connect directly to the internet, in this case, to pull the image. Always all the worker nodes download the docker image?? Each of the nodes download the image directly from the internet? The master doesn't participate in this transfer or data? Thanks! – Claira Oct 05 '18 at 13:34
  • 1
    Yes. The K8S components in the master are deployed as containers, so when you update the K8S version then the new containers are downloaded on master. But, the workload images are downloaded on the minions. – Praveen Sripati Oct 05 '18 at 13:51
2

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
  • 6,521
  • 2
  • 16
  • 32