Cluster Architecture & Kubectl
Kubernetes operates on a distributed master-worker architecture designed for high availability, fault tolerance, declarative state management, and seamless scaling.
1. High-Level Architecture Overview
Section titled “1. High-Level Architecture Overview”A Kubernetes cluster consists of two distinct operational tiers:
- The Control Plane (Master Nodes): Maintains desired state, evaluates scheduling requirements, detects host failures, and exposes the cluster API.
- Worker Nodes (Data Plane): The physical or virtual servers that execute containerized workloads with compute, memory, storage, and networking resources.
┌────────────────────────────────────────────────────────────────────────┐ │ CONTROL PLANE (MASTER) │ │ │ │ ┌─────────────────┐ ┌─────────────────┐ ┌───────────────┐ │ │ │ kube-scheduler │◄────►│ kube-apiserver │◄───►│ controller- │ │ │ │ │ │ (Port 6443) │ │ manager │ │ │ └─────────────────┘ └────────┬────────┘ └───────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────┐ │ │ │ etcd │ │ │ │ (Port 2379) │ │ │ └─────────────┘ │ └─────────────────────────────────────┬──────────────────────────────────┘ │ Secure TLS / mTLS ┌───────────────────────┴───────────────────────┐ ▼ ▼ ┌───────────────────────────┐ ┌───────────────────────────┐ │ WORKER NODE 1 │ │ WORKER NODE 2 │ │ │ │ │ │ ┌─────────────────────┐ │ │ ┌─────────────────────┐ │ │ │ kubelet │ │ │ │ kubelet │ │ │ │ (Port 10250) │ │ │ │ (Port 10250) │ │ │ └──────────┬──────────┘ │ │ └──────────┬──────────┘ │ │ │ CRI │ │ │ CRI │ │ ┌──────────▼──────────┐ │ │ ┌──────────▼──────────┐ │ │ │ Container Runtime │ │ │ │ Container Runtime │ │ │ │ (containerd / CRI-O)│ │ │ │ (containerd / CRI-O)│ │ │ └──────────┬──────────┘ │ │ └──────────┬──────────┘ │ │ │ │ │ │ │ │ ┌──────────▼──────────┐ │ │ ┌──────────▼──────────┐ │ │ │ Pod 1 │ Pod 2 │ │ │ │ Pod 3 │ Pod 4 │ │ │ └─────────────────────┘ │ │ └─────────────────────┘ │ │ │ │ │ │ ┌─────────────────────┐ │ │ ┌─────────────────────┐ │ │ │ kube-proxy │ │ │ │ kube-proxy │ │ │ │ (iptables / IPVS) │ │ │ │ (iptables / IPVS) │ │ │ └─────────────────────┘ │ │ └─────────────────────┘ │ └───────────────────────────┘ └───────────────────────────┘2. Control Plane Components
Section titled “2. Control Plane Components”kube-apiserver(Port 6443): Central communication hub exposing the JSON/Protobuf REST API over HTTPS. Handles authentication, authorization (RBAC), and admission control. Only component with direct access toetcd.etcd(Port 2379/2380): Distributed key-value store implementing the Raft consensus algorithm. Persists the complete declarative state and runtime status of every object in the cluster.kube-scheduler(Port 10259): Analyzes resource requirements, affinity/anti-affinity specifications, and node constraints to bind unscheduled Pods to suitable Worker Nodes.kube-controller-manager(Port 10257): Executes continuous background loops reconciling actual cluster state with desired state (NodeController, DeploymentController, EndpointSliceController).cloud-controller-manager: Connects cloud-provider APIs for provisioning cloud load balancers, VPC routing, and storage volumes.
3. Worker Node Components
Section titled “3. Worker Node Components”kubelet(Port 10250): System agent running on every node. Communicates withkube-apiserverto register the node, monitor assigned Pods, invoke the container runtime via CRI, and report health status.kube-proxy(Port 10256): Manages host networking rules using iptables or IPVS to route cluster-internal Service virtual IPs (ClusterIP) to target Pod endpoints.- Container Runtime: Low-level engine (such as
containerdorCRI-O) responsible for pulling images and launching container cgroups and namespaces.
4. Kubectl: The Command-Line Interface
Section titled “4. Kubectl: The Command-Line Interface”kubectl reads credentials from ~/.kube/config to send authenticated REST requests to the API Server.
# Test cluster connectivitykubectl cluster-info
# View cluster nodes and health statuskubectl get nodes -o wide
# View all running resources across the clusterkubectl get all -A