Architecture of a kubernetes

This blog shows the architecture of a kubernetes and the flow when a pod is scheduled to be run on a node.

Architecture

The following figure is the architecture of a kubernetes.

A kubernetes cluster consists of master nodes that run as control plane and worker node that pods (the object on which containers run) run on.

Flow when a pod is scheduled

The following is the flow when a pod is scheduled to be run on worker nodes.

(1) Run kubectl command to apply a manifest file (definition of a state of a pod), the data is written in etcd (No SQL database containing all cluster information) via API server.

(2) Scheduler periodically checks the data of etcd via API server.
If there is a pod to be scheduled on a node, scheduler decides the node that the pod is to be run on and writes that information on etcd.

(3) Kubelet on a worker node periodically checks etcd via API server to find pods to be run on itself.

(4) As a result of above (3), if there is a pod to be run on a worker node, kubelet creates a pod.

That’s about it.