Pods Creation Process Flow

Let’s take an example with the above Kubernetes cluster.

Before we deploy any pods in the Kubernetes cluster, first we need to build the docker image that the pod will use.

Step1) Admin/developer will build a container image of the application that needs to be deployed in the cluster.

Once the image is ready they push that to the container repository such as Docker Hub.

Step2) Then developer writes the object configuration in the YAML or JSON format.

This YAML file includes specifications of the container image and its configuration, once it is ready, it is submitted to the Kube API server through kubectl command.

Kube API validates the object configuration by checking the user credential, whether he/she has permissions to perform this operation and other things.

Step3) If all checks are passed, then all configurations of the pods will save the configuration in the ETCD database then the API server will notify the scheduler to check the healthy node, here the scheduler may check memory, CPU, node capacity, labels, and more.

Step4) Once the scheduler finds the correct worker node, then the scheduler respective worker node to pods in the ETCD database through the Kube API server.

Step5) API server informs the kubelet running on the specific node and kubenet running on that worker node informs the container runtime interface ie. docker to start downloading the corresponding docker image and deploy pod on that node.

So far, they are no involvement of the control manager and Kube proxy.

The controller manager will get involved when we create pods using deployment or replica set, and the task of controllers is to make sure that these numbers of pods are always running as defined.

And KubeProxy gets involved when two pods need to be communicated using a service object, also playing a crucial role in pod networking and communication.

Below is an example of a pod YAML file with two containers.

Deploy the YAML file using kubectl command.

Once a pod gets created successfully, we can display the complete pod object details and events using the described command.

Here you can see the list of events that occur while creating this pod.

Here, the scheduler finds the worker node02 and pulls the Nginx Docker image and after successfully downloading these images it creates and starts the Nginx container.

Similarly, the Redis image is pulled and created and starts the Redis container.

Also, check

Kubernetes Tutorials




DevOps Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Using Xcode In Mac Os X For C++ Programming

The Chande Momentum Oscillator — Presenting & Coding in Python.

Research Paper Summary Paragraph Frame

A New Way To Trade Moving Averages — A Study in Python.

Quadruple Moving Average Trading Strategy in Python

TRICK: Easy Requirements Build

Creating a Game Over Screen in Unity

Regression Testing: Why You Should Incorporate It Into Your Quality Assurance Process

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


DevOps Engineer

More from Medium

ReplicaSet YAML Walkthrough

Kubernetes Application High-Availability — Part 1 (The Very-Basic Basics)

Kubernetes Resource Confirmation

Connect to Azure Kubernetes Service from your local