> For the complete documentation index, see [llms.txt](https://notes.nomanaziz.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.nomanaziz.me/devops/orchestration/kubernetes/2.-k8s-architecture.md).

# 2. K8s Architecture

### Node Processes

* Each Node has multiple Pods in it
* Worker Nodes do the actual work
* 3 processes must be installed on every Node
  1. **Container Runtime**
     * Docker or other technology
  2. **Kublet**
     * Interacts with both container and node
     * It starts the pod with a container inside
  3. **Kube proxy**
     * Forwards the requests between nodes

***

### Master Processes

* 4 processes must be installed on every master node which controls cluster state and worker nodes
  1. **API Server**
     * Could be UI, API, CLI, [Kubectl](/devops/orchestration/kubernetes/3.-minikube-and-kubectl.md))
     * Acts as cluster gateway
     * Acts as gatekeeper for authentication
  2. **Scheduler**
     * API Server after validation of request hands over the request to scheduler
     * It just decides on which node new pod should be scheduled based on current resources of nodes
     * Kublet is the actual component which does the scheduling after getting request form scheduler
  3. **Controller Manager**
     * Detec cluster state changes like dying of podes
     * It makes a request to scheduler to restart the pod
  4. **etcd**
     * It is the cluster brain
     * cluster changes get stored in the key value store
     * application data is not stored in etcd
* On multiple master nodes
  * API server is load balanced
  * etcd forms distributed storage across all master nodes

<figure><img src="/files/teQB5A1E5zMo6dsCz5pW" alt=""><figcaption></figcaption></figure>
