I came across two different theories of k8s working
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
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
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.