0
0
Kubernetesdevops~15 mins

Kubernetes architecture (control plane and nodes) - Deep Dive

Choose your learning style9 modes available
Overview - Kubernetes architecture (control plane and nodes)
What is it?
Kubernetes architecture is the design of how Kubernetes manages and runs containerized applications. It consists of a control plane that makes decisions and worker nodes that run the applications. The control plane manages the cluster state, while nodes execute the containers. Together, they ensure applications run reliably and scale automatically.
Why it matters
Without Kubernetes architecture, managing many containers across multiple machines would be chaotic and error-prone. It solves the problem of coordinating resources, scaling applications, and recovering from failures automatically. This makes deploying and running applications faster, more reliable, and less manual.
Where it fits
Learners should first understand basic container concepts and Docker. After Kubernetes architecture, they can learn about deploying applications, services, and advanced cluster management like networking and storage.
Mental Model
Core Idea
Kubernetes architecture is like a smart manager (control plane) directing workers (nodes) to run tasks (containers) efficiently and reliably.
Think of it like...
Imagine a factory where the control plane is the manager who plans and assigns work, and the nodes are the workers who do the actual jobs. The manager keeps track of progress and fixes problems, while workers focus on their tasks.
┌─────────────────────────────┐
│        Control Plane         │
│ ┌─────────────┐ ┌─────────┐ │
│ │ API Server  │ │Scheduler│ │
│ ├─────────────┤ ├─────────┤ │
│ │Controller   │ │ etcd    │ │
│ │Manager      │ │(store)  │ │
│ └─────────────┘ └─────────┘ │
└────────────┬────────────────┘
             │
             ▼
┌─────────────────────────────┐
│           Nodes             │
│ ┌─────────────┐ ┌─────────┐ │
│ │ Kubelet     │ │ Pods    │ │
│ │ (agent)     │ │(containers)│
│ └─────────────┘ └─────────┘ │
└─────────────────────────────┘
Build-Up - 7 Steps
1
FoundationWhat is Kubernetes architecture
🤔
Concept: Introduce the basic parts of Kubernetes: control plane and nodes.
Kubernetes architecture has two main parts: the control plane and the nodes. The control plane is like the brain that controls everything. Nodes are machines that run your applications inside containers.
Result
You understand the two main parts that make Kubernetes work.
Knowing the two main parts helps you see how Kubernetes organizes work between decision-making and execution.
2
FoundationRole of the control plane components
🤔
Concept: Explain the main components inside the control plane and their jobs.
The control plane has several parts: - API Server: talks to users and nodes. - Scheduler: decides which node runs a new container. - Controller Manager: keeps the cluster running smoothly. - etcd: stores all the cluster data safely. These parts work together to manage the cluster.
Result
You know what each control plane component does.
Understanding control plane parts clarifies how Kubernetes makes decisions and keeps track of everything.
3
IntermediateHow nodes run containers with kubelet
🤔Before reading on: do you think nodes run containers directly or need an agent? Commit to your answer.
Concept: Introduce kubelet as the agent on nodes that manages containers.
Each node runs an agent called kubelet. Kubelet listens to the control plane and makes sure containers run as expected. It starts, stops, and monitors containers on the node.
Result
You understand how nodes follow control plane instructions to run containers.
Knowing kubelet's role explains how nodes stay in sync with the control plane and keep containers healthy.
4
IntermediatePods as smallest deployable units
🤔Before reading on: do you think Kubernetes runs containers individually or groups them? Commit to your answer.
Concept: Explain that Kubernetes runs containers inside pods, which are groups of containers sharing resources.
Kubernetes does not run containers alone. It runs them inside pods. A pod can have one or more containers that share storage and network. Pods are the smallest units Kubernetes manages.
Result
You know pods group containers and are the basic units Kubernetes schedules.
Understanding pods helps you grasp how Kubernetes organizes containers for networking and resource sharing.
5
IntermediateCommunication between control plane and nodes
🤔
Concept: Describe how control plane and nodes talk to each other.
The API Server is the main communication point. Nodes use kubelet to talk to the API Server. The control plane sends instructions, and nodes report status back. This two-way communication keeps the cluster coordinated.
Result
You see how control plane and nodes stay connected and synchronized.
Knowing this communication flow explains how Kubernetes reacts quickly to changes or failures.
6
Advancedetcd as the cluster’s source of truth
🤔Before reading on: do you think cluster data is stored on each node or centrally? Commit to your answer.
Concept: Explain etcd as the distributed database storing all cluster state data.
etcd is a special database that stores all information about the cluster, like what pods exist and their status. It is distributed and highly available, so the cluster state is safe even if some parts fail.
Result
You understand where Kubernetes keeps its data and why it is reliable.
Knowing etcd’s role reveals how Kubernetes maintains consistency and recovers from failures.
7
ExpertControl plane high availability and scaling
🤔Before reading on: do you think one control plane instance is enough for production? Commit to your answer.
Concept: Discuss how control plane components can run multiple instances for reliability and load handling.
In production, the control plane runs multiple copies of its components on different machines. This setup prevents downtime if one fails and balances the load. etcd also runs as a cluster to keep data safe. This design ensures Kubernetes stays available and responsive.
Result
You know how Kubernetes control plane stays reliable and scalable in real environments.
Understanding control plane high availability prepares you for designing robust Kubernetes clusters.
Under the Hood
The control plane components run as processes that communicate via APIs. The API Server exposes a REST interface that nodes and users call. etcd stores cluster state using a consensus algorithm to keep data consistent across multiple machines. The scheduler watches for new pods and assigns them to nodes based on resource availability. Kubelet on each node continuously polls the API Server for instructions and reports back status. This loop keeps the cluster state synchronized and self-healing.
Why designed this way?
Kubernetes was designed to manage large clusters with many machines and containers. Separating control and execution allows scaling each independently. Using etcd as a distributed key-value store ensures consistent cluster state even with failures. The API Server centralizes communication, simplifying interactions. This modular design supports extensibility and fault tolerance.
┌───────────────┐       ┌───────────────┐
│  User/Client  │──────▶│  API Server   │
└───────────────┘       └──────┬────────┘
                                │
        ┌───────────────────────┼───────────────────────┐
        │                       │                       │
┌───────────────┐       ┌───────────────┐       ┌───────────────┐
│ Scheduler     │       │ Controller    │       │ etcd Cluster  │
│               │       │ Manager       │       │ (Data Store)  │
└───────────────┘       └───────────────┘       └───────────────┘
                                │
                                ▼
                      ┌─────────────────┐
                      │     Nodes       │
                      │ ┌─────────────┐ │
                      │ │   Kubelet   │ │
                      │ └─────────────┘ │
                      │ ┌─────────────┐ │
                      │ │   Pods      │ │
                      │ │ (Containers) │ │
                      │ └─────────────┘ │
                      └─────────────────┘
Myth Busters - 4 Common Misconceptions
Quick: Do you think the control plane runs your application containers? Commit yes or no.
Common Belief:The control plane runs the application containers directly.
Tap to reveal reality
Reality:The control plane only manages and schedules containers; nodes run the containers.
Why it matters:Believing this causes confusion about where workloads run and how resources are managed, leading to misconfiguration.
Quick: Do you think pods are just single containers? Commit yes or no.
Common Belief:A pod is just one container.
Tap to reveal reality
Reality:A pod can contain one or more containers that share resources and network.
Why it matters:Misunderstanding pods limits your ability to design multi-container applications that share data or sidecar patterns.
Quick: Do you think etcd is optional for Kubernetes? Commit yes or no.
Common Belief:etcd is optional and can be replaced by any database.
Tap to reveal reality
Reality:etcd is essential as the consistent, distributed store for cluster state; replacing it breaks Kubernetes functionality.
Why it matters:Ignoring etcd’s role risks data loss and cluster instability.
Quick: Do you think one control plane instance is enough for production? Commit yes or no.
Common Belief:A single control plane instance is sufficient for production clusters.
Tap to reveal reality
Reality:Production clusters require multiple control plane instances for high availability and fault tolerance.
Why it matters:Running a single control plane risks downtime and data loss if it fails.
Expert Zone
1
Control plane components communicate via the API Server, which acts as a single source of truth and gatekeeper for all cluster operations.
2
Kubelet does not just run containers; it also monitors node health and reports back, enabling self-healing and autoscaling.
3
etcd uses the Raft consensus algorithm to maintain consistency across distributed nodes, which is critical for cluster reliability.
When NOT to use
Kubernetes architecture is not suitable for very small or simple applications where container orchestration overhead is unnecessary. Alternatives like Docker Compose or single-node container runtimes are better for local development or simple deployments.
Production Patterns
In production, Kubernetes clusters use multiple control plane nodes for high availability, separate etcd clusters for data safety, and node pools to group nodes by hardware or purpose. Operators also use monitoring and logging integrated with the control plane to maintain cluster health.
Connections
Distributed Systems
Kubernetes architecture builds on distributed system principles like consensus, fault tolerance, and leader election.
Understanding distributed systems helps grasp how Kubernetes maintains cluster state reliably across many machines.
Factory Management
Kubernetes control plane and nodes mirror how a factory manager assigns tasks to workers and monitors progress.
Seeing Kubernetes as a management system clarifies its separation of decision-making and execution roles.
Operating System Process Scheduling
Kubernetes scheduler is similar to an OS scheduler that assigns CPU time to processes, but at a cluster scale.
Knowing OS scheduling concepts helps understand how Kubernetes decides where to run pods efficiently.
Common Pitfalls
#1Confusing control plane with nodes and trying to run containers on control plane machines.
Wrong approach:Deploying application containers directly on control plane nodes without proper separation.
Correct approach:Run application containers only on worker nodes; keep control plane dedicated to management tasks.
Root cause:Misunderstanding the separation of responsibilities in Kubernetes architecture.
#2Ignoring etcd backup and recovery planning.
Wrong approach:Not backing up etcd data or assuming it can be rebuilt easily.
Correct approach:Regularly back up etcd data and test recovery procedures to protect cluster state.
Root cause:Underestimating the critical role of etcd as the cluster’s source of truth.
#3Running a single control plane instance in production.
Wrong approach:Setting up Kubernetes with only one control plane node for simplicity.
Correct approach:Deploy multiple control plane nodes with load balancing for high availability.
Root cause:Lack of awareness about production reliability requirements.
Key Takeaways
Kubernetes architecture separates control (decision-making) and execution (running containers) into control plane and nodes.
The control plane components like API Server, Scheduler, Controller Manager, and etcd work together to manage cluster state and scheduling.
Nodes run containers inside pods, with kubelet acting as the agent that communicates with the control plane.
etcd is the distributed database that stores all cluster data reliably and consistently.
High availability of the control plane is essential for production to avoid downtime and data loss.