What You Will Learn
Intermediate
- Each control plane component in detail
- How they work together
- What happens when a component fails
API Server
The API Server is the front-end of the control plane. All K8s operations go through it - kubectl, dashboard, controllers, everything. It validates and processes REST requests.
Terminalbash
# Everything goes through the API server
kubectl get pods # -> API Server -> etcd
kubectl apply -f deploy.yaml # -> API Server -> etcdetcd
etcd is a distributed key-value store. It is the single source of truth for the cluster. All cluster state - pods, services, configs - is stored here.
etcd is critical
If etcd is lost and not backed up, the entire cluster state is gone. Always back up etcd in production: etcdctl snapshot save backup.dbScheduler
The Scheduler watches for new Pods with no assigned node. It evaluates resources, affinity rules, and constraints to pick the best node for each Pod.
Controller Manager
Runs reconciliation loops. It constantly compares desired state (from YAML) with actual state (from etcd). If they differ, it takes action.
Reconciliation loop example
Desired: 3 replicas. Actual: 2 (one Pod crashed). Controller notices the gap and creates 1 new Pod. This is self-healing.Practical Exercise
Run: kubectl get componentstatuses (check control plane health)
Run: kubectl api-resources (see all resource types the API server manages)
Run: minikube ssh, then: docker ps | grep etcd (see etcd running)
Key Takeaways
- API Server: entry point for all K8s operations.
- etcd: key-value store - the source of truth. BACK IT UP!
- Scheduler: assigns Pods to nodes based on resources and rules.
- Controller Manager: runs reconciliation loops (desired vs actual).
- Self-healing = Controller Manager noticing gaps and fixing them.
Comments
Comments
Post a Comment