Kubernetes
What happens when you run a Pod with kubectl?
Difficulty: unrated
Source: bregman-arie/devops-exercises
by Arie Bregman
Answer
- Kubectl sends a request to the API server (kube-apiserver) to create the Pod
- In the the process the user gets authenticated and the request is being validated.
- etcd is being updated with the data
- The Scheduler detects that there is an unassigned Pod by monitoring the API server (kube-apiserver)
- The Scheduler chooses a node to assign the Pod to
- etcd is being updated with the information
- The Scheduler updates the API server about which node it chose
- 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
- Kubelet sends request to the container engine (e.g. Docker) to create and run the containers
- An update is sent by Kubelet to the API server (notifying it that the Pod is running)
- etcd is being updated by the API server again