k8s:core:cluster_model
Differences
This shows you the differences between two versions of the page.
| k8s:core:cluster_model [2026/05/31 02:30] – created phong2018 | k8s:core:cluster_model [2026/05/31 02:48] (current) – phong2018 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== Cluster Model ====== |
| A Kubernetes cluster is a group of machines that work together to run applications. | A Kubernetes cluster is a group of machines that work together to run applications. | ||
| - | It has two main parts: | + | It is made of: |
| + | * Control Plane (brain) | ||
| + | * Worker Nodes (workers) | ||
| + | * Pods (applications) | ||
| + | |||
| + | --- | ||
| ===== 1. Control Plane ===== | ===== 1. Control Plane ===== | ||
| - | This is the " | ||
| - | It manages: | + | The Control Plane is the **brain of Kubernetes**. |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Key components: | + | It decides: |
| - | * API Server → entry point for all commands | + | * Where applications run |
| - | * Scheduler → decides where pods run | + | * How many copies |
| - | * Controller Manager → ensures desired state | + | * What happens when something fails |
| - | * etcd → key-value database storing cluster state | + | |
| + | Example: | ||
| + | * You say: "Run 3 replicas of my app" | ||
| + | * Control Plane ensures it happens | ||
| + | |||
| + | --- | ||
| ===== 2. Worker Nodes ===== | ===== 2. Worker Nodes ===== | ||
| - | These are the machines that run your applications. | ||
| - | Each node contains: | + | Worker Nodes are machines |
| - | * kubelet → agent that communicates with control plane | + | |
| - | | + | |
| - | | + | |
| - | Nodes run: | + | Example: |
| - | * Pods (your application containers) | + | |
| + | |||
| + | Node A → runs Pod 1, Pod 2 | ||
| + | Node B → runs Pod 3 | ||
| + | |||
| + | |||
| + | If a node fails: | ||
| + | * Kubernetes moves Pods to another node | ||
| + | |||
| + | --- | ||
| ===== 3. Pods ===== | ===== 3. Pods ===== | ||
| - | The smallest unit in Kubernetes. | ||
| - | A pod: | + | A Pod is the **smallest unit in Kubernetes**. |
| - | | + | |
| - | | + | |
| - | | + | |
| - | ===== Cluster flow ===== | + | Example: |
| + | |||
| + | A Pod contains: | ||
| + | * Your application container (e.g. nginx) | ||
| + | * Optional helper containers | ||
| Example: | Example: | ||
| - | User → Service → Pod → Node | ||
| - | Control Plane decides: | + | Pod = Web App Container |
| - | * Where the pod should run | + | |
| - | * How many replicas exist | + | |
| - | * When to restart failed pods | + | --- |
| + | |||
| + | ===== Full flow example ===== | ||
| + | |||
| + | User request flow: | ||
| + | |||
| + | |||
| + | User | ||
| + | ↓ | ||
| + | Service | ||
| + | ↓ | ||
| + | Pod | ||
| + | ↓ | ||
| + | Node | ||
| + | |||
| + | |||
| + | Control Plane ensures: | ||
| + | * Pods are created | ||
| + | * Pods are healthy | ||
| + | * Pods are distributed across nodes | ||
| + | |||
| + | --- | ||
| + | |||
| + | ===== Simple analogy ===== | ||
| - | ===== Key idea ===== | + | Think of a factory: |
| - | Kubernetes cluster = | + | |
| - | Control Plane (brain) | + | |
| - | + | + | |
| - | Worker Nodes (workers) | + | |
| - | + | + | |
| - | Pods (applications) | + | |
k8s/core/cluster_model.1780194628.txt.gz · Last modified: by phong2018
