Core Concepts
Kubernetes architecture is built around three core concepts: nodes, clusters, and the control plane. These form the foundation for managing containerized workloads across a distributed system. Alongside these concepts, key components like the API server, etcd, and kubelet orchestrate the cluster's operations. Understanding these elements is essential for deploying and managing Kubernetes at scale.
Core Concepts¶
Nodes¶
A node is a worker machine (physical or virtual) that runs containerized applications. Each node has:
- kubelet: A critical agent that ensures containers are running as specified by the control plane. It communicates with the API server and manages the lifecycle of containers.
- kube-proxy: A network proxy that routes traffic to the correct pods.
Example:
Clusters¶
A cluster is a set of nodes managed by the control plane. It consists of:
- Master nodes (control plane): Host components like the API server, etcd, scheduler, and controller manager.
- Worker nodes: Run applications and are managed by the control plane.
Clusters are often divided into control plane (master) and worker nodes, though modern deployments may distribute control plane components across multiple nodes for high availability.
Control Plane¶
The control plane manages the cluster's state and ensures desired conditions are met. Its core components include:
- API server: The front-end for the control plane, handling REST requests and communication between components.
- etcd: A distributed key-value store that stores the cluster's state (e.g., node status, pod configurations).
- Scheduler: Assigns workloads (pods) to nodes based on resource availability and constraints.
- Controller Manager: Runs controllers that manage resources (e.g., ReplicaSet, Deployment) to ensure desired states.
Example:
Key Components¶
API Server¶
The API server is the primary interface for interacting with the cluster. It processes requests from kubectl, kubelet, and other components, validating and persisting changes to etcd.
Example:
etcd¶
etcd is the distributed database that stores the cluster's state, including node configurations, pod statuses, and secrets. It ensures data consistency and reliability across the control plane.
Example:
kubelet¶
kubelet runs on each node, ensuring containers are created, started, and monitored. It enforces policies like resource limits and communicates with the API server to report node status.
Example:
Key takeaways¶
- Nodes are the worker machines that run containers, managed by the control plane.
- Clusters consist of master and worker nodes, with the control plane orchestrating resources.
- API server is the central hub for cluster communication, while etcd stores the cluster's state.
- kubelet ensures containers run as specified, acting as the bridge between the control plane and nodes.
- Understanding these components is critical for troubleshooting, scaling, and securing Kubernetes deployments.