Kubernetes Architecture: Control Plane, Nodes, Kubelet, kube-proxy, and Container Runtime

ARTIFICIAL INTELLIGENCE

Why understanding the architecture is fundamental

Understanding how a cluster works means understanding why certain practices are recommended, how to diagnose problems, and how to design resilient applications. In this lesson we explore the multi-layer architecture: the control plane, the worker nodes, system daemons like kubelet and kube-proxy, and the role of the container runtime. By the end you’ll have a clear view of how the components talk to each other to provide a coherent, scalable, and reliable distributed system.

Overview: how a cluster “thinks”

A cluster is made up of a control plane that makes decisions and worker nodes that run workloads. Users and operators interact with the central API; the control plane schedules and reconciles the desired state; the nodes start containers, keep them healthy, and route traffic. The architecture is declarative: you specify what you want, and controllers continuously work to align the actual state with the desired state.

Control plane components

kube-apiserver

It is the cluster’s front end: it exposes a REST API and serves as the “entry point” for users, operators, and internal components. All changes go through here. It handles authentication (client certs, tokens, OIDC), authorization (RBAC), and admission (admission controllers). Resources are validated and persisted in the data store. The server is stateless; it scales horizontally behind a load balancer for high availability.

etcd

Distributed key–value store that keeps the cluster’s state. It provides strong consistency thanks to Raft. It should run with an odd number of members to maintain quorum; it is sensitive to latency and I/O. Regular backups and recovery plans are essential, as are resource isolation and at-rest encryption of sensitive data.

kube-scheduler

Decides on which node to run each unscheduled Pod. It applies filters (affinity, taints/tolerations, CPU/RAM availability, topology constraints) and performs scoring (load balancing, data locality, zone spreading). Its goal is to maximize resource utilization while honoring constraints and resilience.

kube-controller-manager

It hosts numerous controllers that implement the “reconciliation loop”: ReplicaSet, Deployment, Job, Endpoints, Node, and many others. Each controller watches the state in the datastore, compares it with the desired state, and takes actions to close the gap (creating/deleting Pods, updating endpoints, managing failover). It’s designed to be idempotent and fault tolerant.

cloud-controller-manager

Present when the cluster is integrated with a cloud provider. It manages the creation and reconciliation of external infrastructure resources: Load Balancers for Services of type LoadBalancer, persistent volumes via the provider’s CSI, node labels with cloud metadata, and removal of nodes that no longer exist.

High availability of the control plane

To avoid single points of failure, run multiple kube-apiserver replicas behind a VIP or load balancer, an etcd cluster with quorum (3 or 5 nodes), and components that perform leader election. Latency between etcd members must be low; tested backups and recovery are indispensable.

The nodes: where the workload runs

The concept of a Pod and fundamental objects

The Pod is the smallest schedulable unit: it can contain one or more containers that share networking and ephemeral storage. Users rarely create naked Pods; they use abstractions such as Deployment, StatefulSet, or DaemonSet to handle replication, updates, and placement.

kubelet

It is the agent on every node. It receives from the control plane the list of desired Pods for that node and interacts with the container runtime via CRI to start them, monitor them, and restart them if needed. It publishes the state of the node (resource capacity, conditions) and of the Pods, runs liveness/readiness/startup probes, manages volumes, and applies cgroups to enforce resource limits. It can also manage static Pods defined in local files, useful for system components.

Container runtime

It implements the CRI (Container Runtime Interface) and handles creating containers, pulling images, managing filesystems, and isolation via namespaces and cgroups. The most common runtimes are containerd and CRI-O. A CRI-compliant runtime makes the platform modular; at a lower level, container execution can rely on runc or alternatives for advanced sandboxing (e.g., gVisor, Kata).

kube-proxy

It handles routing traffic to the Pods behind Services. It implements rules with iptables or IPVS to map the Services’ virtual IPs to the real endpoints. It supports session affinity and basic health checks of endpoints. Some modern CNIs can offer a “proxyless” mode leveraging eBPF, but the idea remains the same: make Services reliably reachable despite Pods’ dynamism.

Pod networking and CNI plugins

Pod-to-Pod connectivity is handled by a CNI plugin (Calico, Cilium, Flannel, Weave, etc.) that allocates IP addresses, configures routing, and often network-level security policies. Key requirements: each Pod has a routable IP within the cluster and can communicate with others without NAT, while external access happens via Services and Ingress/Load Balancer.

From command to reality: the path of a request

When you apply a resource, the API validates and persists it; controllers and the scheduler react, and the nodes execute. Here is a small sequence useful to observe the cycle:

kubectl apply -f app.yaml
kubectl get pods -o wide
kubectl get svc,ep -o wide
kubectl describe pod POD_NAME

In detail: the manifest reaches the server, passes AuthN/AuthZ, admission may mutate it (e.g., inject sidecars), the resource is saved. The scheduler selects a node while honoring constraints. The kubelet on the chosen node pulls the image if missing, creates the containers, configures volumes, and activates the probes. When the readiness probes pass, the Service’s endpoints include the Pod; kube-proxy (or the eBPF equivalent) updates the routing rules and traffic starts to flow.

Security and isolation

Cluster access is protected by end-to-end TLS, authentication, and granular RBAC. Admission policies (e.g., OPA/Gatekeeper or Kyverno validators) enforce corporate standards. Namespaces segment application spaces; NetworkPolicies limit east–west connectivity; Secrets and ConfigMaps manage configuration and credentials. At the Pod level, harden profiles with Pod Security (or equivalent policies), seccomp, AppArmor, and removal of unnecessary capabilities.

Observability, health, and resilience

Every node exposes metrics (via cAdvisor) that feed cluster metrics through components like metrics-server or a Prometheus stack. Pod probes report health to the kubelet; events provide a chronological audit of cluster decisions. For resilience: controllers maintain the desired number of replicas, PodDisruptionBudgets limit simultaneous disruptions, while controllers handle rebalancing when nodes become NotReady. For high availability, etcd remains the heart: an intact quorum prevents split-brain and data loss.

Storage and data persistence

Persistence is abstracted by PersistentVolume (PV) and PersistentVolumeClaim (PVC). CSI drivers enable dynamic provisioning on local, network, or cloud storage (block, file, object). It’s important to correctly choose access modes (ReadWriteOnce vs ReadWriteMany), performance, replication, and reclaim policies. StatefulSet coordinates stable Pod identities and dedicated volumes for stateful workloads.

Operational best practices

– Always define resource requests/limits to enable predictable scheduling and prevent resource contention.

– Use readiness probes for traffic, liveness for self-healing, and startup for apps that start slowly.

– Apply affinity/anti-affinity and topology spread constraints to distribute replicas across nodes and zones.

– Manage updates with rolling and canary strategies; use revisions and automatic rollbacks of Deployments.

– Secure the network with NetworkPolicies and, where possible, leverage eBPF for observability and performance.

– Plan maintenance with cordon/drain and appropriate PDBs; constantly monitor etcd and schedule tested backups.

– For exposed Services, choose intentionally among ClusterIP, NodePort, LoadBalancer, and Ingress; for complex L7 traffic, use an Ingress Controller or Gateway API.

Quick verification and troubleshooting

These commands help validate the state of the cluster and networking components:

kubectl get nodes -o wide
kubectl get pods -A -o wide
kubectl get svc,ep -A
kubectl describe node NODE_NAME
kubectl events -A --sort-by=.lastTimestamp

If issues arise, follow the flow: does the object exist and is it valid? Is it scheduled? Does the node have resources? Are the probes passing? Are the endpoints populated? Do the network rules route correctly?

Conclusions and next steps

You’ve seen how the brain (control plane) and the hands (nodes with kubelet, container runtime, and kube-proxy) work together to maintain a coherent, elastic, and secure system. This architecture enables teams and platforms to scale without sacrificing control and reliability.

Put it into practice right away: create a test cluster with kind or minikube, deploy a simple application, watch the events, and experiment with probes, resources, and policies. If you want to speed up the journey, enroll in our guided path: hands-on labs, real-world cases, and operational checklists to bring robust, governable environments to production. Start today: your next cluster awaits you.

Se vuoi farmi qualche richiesta o contattarmi per un aiuto riempi il seguente form

    Comments