Kubernetes

What happens when you run a Pod with kubectl?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

  1. Kubectl sends a request to the API server (kube-apiserver) to create the Pod
    1. In the the process the user gets authenticated and the request is being validated.
    2. etcd is being updated with the data
  2. The Scheduler detects that there is an unassigned Pod by monitoring the API server (kube-apiserver)
  3. The Scheduler chooses a node to assign the Pod to
    1. etcd is being updated with the information
  4. The Scheduler updates the API server about which node it chose
  5. Kubelet (which also monitors the API server) notices there is a Pod assigned to the same node on which it runs and that Pod isn't running
  6. Kubelet sends request to the container engine (e.g. Docker) to create and run the containers
  7. An update is sent by Kubelet to the API server (notifying it that the Pod is running)
    1. etcd is being updated by the API server again