# 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](https://notes.nomanaziz.me/devops/orchestration/kubernetes/3.-minikube-and-kubectl))
     * 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="https://1920086362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDfv51K0WXLZdwTryHQZc%2Fuploads%2FSo7b7bx7ZVDgqjBpCAmU%2Fimage.png?alt=media&#x26;token=fdfef472-d083-44d7-90f8-260a34a288cb" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.nomanaziz.me/devops/orchestration/kubernetes/2.-k8s-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
