How does a pod get created in Kubernetes?

How does a pod get created in Kubernetes?

The best way to develop an understanding of the Kubernetes Architecture is by seeing how each component behaves when an action is performed on the cluster.

Even the simplest task such as - 'Creation of a pod' involves a lot of steps.

Understanding how this works would provide much-needed clarity about the functions of each component.

To fully understand the below steps, knowledge of different Kubernetes components is required.

Step 1

  • User issues a kubectl command to create a pod.
  • Kubectl passes this command to api-server.
  • Api-server validates this command & acts on it.

Step 2

  • Api-server passes the information to etcd.
  • Etcd creates a record for this new pod. (which is yet to be created right now)

Step 3

  • The scheduler takes cognizance of the requirement to create a new pod.
  • It acquires details such as memory, CPU requirements of the pod from api-server.
  • It then returns a worker node where the pod can be scheduled to the api-server.

Step 4

  • Api-server sends the update to the etcd.
  • Etcd updates the worker node name for the pod in its key-value store.

An important observation here is that - out of all the components, only api-server communicates with the etcd directly.

Step 5

  • Api-server passes the pod specifications to the kubelet on the worker node.
  • Kubelet provisions the pod & runs the pod on the node's container runtime engine.
  • Kubelet sends updates about the pod's status to the api-server.
  • The api-server sends the updated status to the etcd.

Step 6

  • Once the pod gets into a running state, the api-server returns the status to the user after it's updated on the etcd.

And that's how each component performs its function to create a new pod.

I hope this added to your understanding of the Kubernetes.

If you found this useful, share it with your network!


Ankit Khandelwal

Senior Software Engineer

3y

It was a crisp and clear article.

Like
Reply
Himanshu Singh Tomer

AWS, Cloud Computing,Devops tools , Kubernetes, Terraform, Python , shell scripting , promethues, grafana

3y

Smooth!! 👌

Like
Reply
Sarabesh Neelamegham Ravindranath

MS Data Science student at Indiana University Bloomington | Ex VMware and Ex Presidio

3y

Thank you, now i don't have to watch the tutorial to find the flow when i forget 😅

Like
Reply
Zamin Abbas Abidi

DevOps Engineer at Spinny | AWS | Kubernetes | ECS | Jenkins

3y

Shishir Khandelwal great article help alot in understanding process

Like
Reply
Piyush Ugale

AVP Sr Cloud Platform Engineer@JP Morgan & Chase, UK | Powering Digital Cloud Transformation

3y

Excellent .. very well explained. Keep posting great stuff !

Like
Reply

To view or add a comment, sign in

More articles by Shishir Khandelwal

  • Navigating API Gateway Choices: A Practical Q&A on AWS API Gateway vs. Kong

    Navigating API Gateway Choices: A Practical Q&A on AWS API Gateway vs. Kong

    Introduction This article is based on an indirect conversation I had with a startup's Head of Engineering while they…

    7 Comments
  • 5 Crucial Tips for a Startup Cloud Infrastructure

    5 Crucial Tips for a Startup Cloud Infrastructure

    Working at a startup has been a whirlwind of learning. When you're the first creator and owner of a critical part of…

  • Creating Validation Admission Webhooks Inside Kubernetes

    Creating Validation Admission Webhooks Inside Kubernetes

    This is the second part of a series of articles discussing Admissions Hooks in Kubernetes. Check out the first article…

    3 Comments
  • The Ultimate Guide To Admission Hooks in Kubernetes

    The Ultimate Guide To Admission Hooks in Kubernetes

    Inside Kubernetes, even the simplest task such as — the ‘Creation of a pod’ involves a lot of steps. Understanding…

    1 Comment
  • Hosting a webpage over custom domain & ssl

    Hosting a webpage over custom domain & ssl

    In this article, we will see the setup of the Domain name, Route53 and Certificate Manager. The main component of the…

    3 Comments
  • Top Kubernetes Commands To Work Faster

    Top Kubernetes Commands To Work Faster

    Kubernetes's kubectl can create objects in two ways - Declarative Used for creating resources from manifest files using…

    5 Comments
  • Automating Route53 record creations

    Automating Route53 record creations

    Kubernetes clusters use an Ingress Controller to expose applications to the outside world. For each endpoint or path…

    8 Comments
  • Understanding Public Key Infrastructure

    Understanding Public Key Infrastructure

    Public Key Infrastructure How does a client on the internet communicate with a server on the internet? Is this…

    2 Comments
  • Using Envconsul with Vault

    Using Envconsul with Vault

    In order to use & keep sensitive values safe — we require two things A place where sensitive information can be stored…

    4 Comments
  • Understanding Elasticsearch

    Understanding Elasticsearch

    Understanding the use case The format in which data is stored inside traditional databases like Postgres, Cassandra, or…

    4 Comments

Insights from the community

Others also viewed

Explore topics