βΈοΈ Day 7: Kubernetes Architecture (Control Plane & Data Plane)
Video Overview
This note dives deep into Kubernetes architecture, covering:
- Pods & Deployments (foundation)
- Control Plane vs Data Plane
- Core components (API Server, Scheduler, etc.)
- End-to-end deployment workflow
π This is one of the MOST IMPORTANT topics for CKA.
π¦ Concept 1: What is a Pod?
Important
A Pod is the smallest deployable unit in Kubernetes
π§ Definition
- Pod = Wrapper around container(s)
- Can contain:
- 1 container (most common)
- Multiple containers (advanced use cases)
π¦ Pod = Container Box
- Docker β Container
- Kubernetes β Pod (contains container)
π Multi-Container Pods (Sidecar Pattern)
Info
Multiple containers inside a pod follow Sidecar Pattern
Common Use Cases:
- π Logging β collect logs
- π Monitoring β send metrics
- π Proxy β outbound requests
- π Reverse Proxy β handle incoming traffic
π Shared Resources in Pod
Important
Containers inside a pod share:
- π Network
- Same IP
- Access via
localhost
- πΎ Storage
- Shared volumes
π Concept 2: What is a Deployment?
Important
Deployment ensures your app is always running
π Why not just Pod?
- If pod dies β no recovery β
β Deployment Features:
π 1. Replica Management
- Define number of pods:
- Example:
replicas = 10
- Example:
- Kubernetes ensures 10 always run
π 2. Rolling Updates & Rollbacks
- Update without downtime
- Rollback if failure
π 3. Declarative Configuration
Quote
You define βdesired stateβ β Kubernetes maintains it
π§ Concept 3: Kubernetes Architecture Overview
Example
Cluster = Control Plane + Data Plane
π§ Control Plane (Brain π§ )
Important
Manages entire cluster
- Must be Highly Available
- Responsible for:
- Decisions
- Scheduling
- State management
βοΈ Data Plane (Workers)
Important
Runs actual applications (Pods)
- Contains:
- Worker Nodes
- Containers
π§© Concept 4: Control Plane Components
π API Server
Important
Entry point to Kubernetes
- All requests go through API Server
- Handles:
- Authentication
- Authorization
- Validation
ποΈ etcd
Important
Key-value database
- Stores:
- Cluster state
- Configurations
- Must be:
- Backed up
- Highly available
βοΈ Controller Manager
Important
Maintains desired state
- Runs multiple controllers:
- Deployment controller
- ReplicaSet controller
π Scheduler
Important
Assigns pods to nodes
- Based on:
- CPU / Memory
- Rules (e.g., GPU required)
βοΈ Cloud Controller Manager
Info
Connects Kubernetes with cloud providers
- AWS, Azure, GCP integrations
π§© Concept 5: Data Plane Components
π Kubelet
Important
Node agent
- Runs on every node
- Responsibilities:
- Start containers
- Monitor health
- Talk to API Server
βοΈ Container Runtime
Info
Runs containers
- Examples:
- containerd
- CRI-O
π kube-proxy
Important
Network traffic manager
- Handles:
- Service β Pod routing
- Load balancing
- Health checks
π Concept 6: Kubernetes Service
Important
Logical abstraction for pods
β Problem:
- Pods have dynamic IPs
β Solution:
- Use Service
- Traffic goes:
Pod β Service β Target Pod
π Concept 7: CNI (Container Network Interface)
Important
Core networking system in Kubernetes
Responsibilities:
- Assign IPs to pods
- Pod-to-Pod communication
- Network policies
- IP management
β‘ Advanced Insight
Tip
Some CNI plugins can replace kube-proxy
Examples:
- Calico
- Cilium
π§ Concept 8: Deployment Workflow (VERY IMPORTANT)
End-to-End Flow
Step 1: User Command
kubectl apply -f app.yamlStep 2: kubectl
- Validates YAML
- Sends request to API Server
Step 3: API Server
- Authenticates user
- Validates schema
- Stores in etcd
Step 4: Controller Manager
- Detects mismatch
- Creates:
- Deployment β ReplicaSet β Pods
Step 5: Scheduler
- Assigns nodes to pods
Step 6: Kubelet
- Pulls image
- Starts containers
π Final Flow Summary
Quote
kubectl β API Server β etcd β Controller β Scheduler β Kubelet β Container Runtime
π§± Concept 9: Object Hierarchy
Important
Deployment
β
ReplicaSet
β
Pod
β
Container
β Concept 10: Kubernetes Add-ons
Info
Extend cluster functionality
π§ Examples:
- π Metrics Server β CPU/memory data
- π CoreDNS β DNS resolution
- π CNI β Networking
- πΎ CSI β Storage
- π Dashboard β UI for cluster
β οΈ Key Understanding
Important
Kubernetes is modular β supports plugins
π§ Final Takeaways
Summary
- Pod = smallest unit
- Deployment = manages pods
- Control Plane = brain
- Data Plane = execution
- API Server = entry point
- etcd = source of truth
π One-Line Summary
Quote
Kubernetes = Brain (Control Plane) + Workers (Data Plane) managing Pods at scale βΈοΈ