How K8s creates pod?

I came across two different theories of k8s working

  1. that is scheduler looks for pod with node field in the definition of pod in etcd with no entry, then it will look for a node to schedule the. Pod
  2. The controller checks the etcd and sees that their is a difference between current state and desired state, then controller will ask scheduler to look for a suitable node to create pods

I just wanted to know whether what will happen from the beginning to end of pod creation

Thanks in advance

Hi @rakrakshith77

May be the following post can help you :

To resume :

  • If on the pod definition we don’t have any node Name , node selector, toleration, … the scheduler checks the optimal nod and deploys the pod there

  • if a node name, node selector, toleration of affinity is defined, the schedule will manage with this information.

  • if a pod already exists, he depends on our you manage it, if you do an apply he’ll patch directly the existed pod on the same node. If you do a replace, he’ll delete and create a new pod then the process starts on the beginning.