02 - Components

Kubernetes Components Overview

Kubernetes is built from multiple components that work together to manage, schedule, scale, and maintain containerized applications. Understanding these components is essential for troubleshooting clusters and designing production-ready systems.


Control Plane Components

The Control Plane is responsible for managing the entire Kubernetes cluster. It makes decisions about scheduling, scaling, networking, and maintaining the desired state.


kube-apiserver

The API Server is the central communication hub of Kubernetes.

Every command, request, or update goes through the API server — whether it comes from kubectl, controllers, or internal cluster components.

Responsibilities

  • Exposes the Kubernetes API
  • Validates and processes requests
  • Stores cluster state in etcd
  • Acts as the gateway for all cluster communication

Why It Matters

Without the API server, the cluster cannot function because all components depend on it for communication.


etcd

etcd is a distributed key-value database used by Kubernetes to store all cluster data.

It contains:

  • Cluster configuration
  • Deployments
  • Secrets
  • Service discovery information
  • Current cluster state

Responsibilities

  • Stores the desired and current cluster state
  • Provides high availability and consistency
  • Acts as the single source of truth

Why It Matters

If etcd is lost or corrupted, the entire cluster state can disappear.


kube-scheduler

The Scheduler decides on which node a Pod should run.

When a new Pod is created, the scheduler evaluates available nodes and selects the most suitable one.

Responsibilities

  • Watches for unscheduled Pods
  • Selects the best node
  • Evaluates:
    • CPU and memory availability
    • Affinity rules
    • Taints and tolerations
    • Resource constraints

Why It Matters

Efficient scheduling improves cluster performance and resource utilization.


kube-controller-manager

The Controller Manager runs controllers that continuously monitor the cluster state and make adjustments when needed.

Controllers operate using reconciliation loops:

Desired state vs Actual state

Important Controllers

Node Controller

Monitors node availability.

ReplicaSet Controller

Ensures the correct number of Pods are running.

Deployment Controller

Handles rolling updates and deployments.

Job Controller

Manages batch jobs and one-time tasks.

Responsibilities

  • Maintains desired cluster state
  • Automatically reacts to failures
  • Handles self-healing behavior

Why It Matters

This component is the reason Kubernetes is self-healing and automated.


cloud-controller-manager

Used when Kubernetes runs in cloud environments such as AWS, Azure, or GCP.

It integrates Kubernetes with cloud provider APIs.

Responsibilities

  • Manages load balancers
  • Handles cloud storage volumes
  • Manages node lifecycle
  • Integrates networking

Why It Matters

It enables Kubernetes to use cloud-native infrastructure automatically.


Node Components

Worker nodes are machines where applications actually run.


kubelet

The kubelet is the primary agent running on every node.

It communicates with the API server and ensures containers are running correctly.

Responsibilities

  • Starts and stops containers
  • Monitors Pod health
  • Reports node status
  • Executes Pod specifications

Why It Matters

Without kubelet, a node cannot participate in the cluster.


kube-proxy

kube-proxy manages networking rules on each node.

It enables communication between Pods and Services.

Responsibilities

  • Handles Service networking
  • Maintains iptables/ipvs rules
  • Enables load balancing across Pods

Why It Matters

It allows applications to communicate reliably inside the cluster.


Container Runtime

The container runtime is responsible for actually running containers.

Popular runtimes:

  • containerd
  • CRI-O
  • Docker (legacy support)

Responsibilities

  • Pulls container images
  • Starts containers
  • Stops containers
  • Manages container lifecycle

Why It Matters

Kubernetes itself does not run containers directly — the runtime does.


Kubernetes Workload Components

These are the objects developers interact with most often.


Pod

A Pod is the smallest deployable unit in Kubernetes.

A Pod usually contains:

  • One application container
  • Shared networking
  • Shared storage

Responsibilities

  • Runs application workloads
  • Hosts containers
  • Provides isolated execution environments

Why It Matters

Everything in Kubernetes ultimately runs inside Pods.


ReplicaSet

A ReplicaSet ensures a specific number of identical Pods are always running.

Responsibilities

  • Maintains Pod replicas
  • Recreates failed Pods automatically

Why It Matters

Provides high availability and redundancy.


Deployment

A Deployment manages ReplicaSets and application updates.

Responsibilities

  • Rolling updates
  • Rollbacks
  • Scaling applications
  • Declarative application management

Why It Matters

Deployments are the standard way to run stateless applications.


StatefulSet

Used for stateful applications like databases.

Responsibilities

  • Stable Pod identities
  • Persistent storage
  • Ordered deployments

Why It Matters

Critical for databases and distributed systems.


DaemonSet

Ensures one Pod runs on every node.

Common Use Cases

  • Monitoring agents
  • Log collectors
  • Security tools

Why It Matters

Useful for cluster-wide services.


Job

A Job runs a task until completion.

Responsibilities

  • Executes batch workloads
  • Restarts failed tasks if necessary

Why It Matters

Ideal for automation and data processing.


CronJob

A CronJob runs Jobs on a schedule.

Example Use Cases

  • Backups
  • Scheduled reports
  • Cleanup scripts

Why It Matters

Enables time-based automation inside Kubernetes.


Networking Components


Service

A Service provides stable networking access to Pods.

Since Pods are ephemeral and change IP addresses, Services provide a permanent endpoint.

Types

  • ClusterIP
  • NodePort
  • LoadBalancer

Why It Matters

Enables reliable communication between applications.


Ingress

Ingress manages external HTTP/HTTPS access to services.

Responsibilities

  • Routing traffic
  • SSL termination
  • Virtual hosting

Why It Matters

Acts as the entry point into the cluster.


CoreDNS

CoreDNS provides internal DNS for Kubernetes.

Responsibilities

  • Resolves service names
  • Enables service discovery

Why It Matters

Applications can communicate using names instead of IP addresses.


Configuration & Storage Components


ConfigMap

Stores non-sensitive configuration data.

Example

  • Environment variables
  • Application configs

Why It Matters

Separates configuration from application code.


Secret

Stores sensitive information securely.

Example

  • Passwords
  • API tokens
  • Certificates

Why It Matters

Improves security and secret management.


PersistentVolume (PV)

Represents physical storage in the cluster.

Why It Matters

Provides persistent data storage independent of Pods.


PersistentVolumeClaim (PVC)

A request for storage by a Pod.

Why It Matters

Allows applications to consume storage dynamically.


Command Line Tool


kubectl

kubectl is the command-line tool used to interact with Kubernetes clusters.

Common Commands

kubectl get pods
kubectl describe pod mypod
kubectl apply -f deployment.yaml
kubectl logs mypod

Responsibilities

  • Deploy applications
  • Inspect resources
  • Troubleshoot clusters
  • Manage configurations

Why It Matters

It is the primary interface administrators and developers use to control Kubernetes.


How All Components Work Together

  1. User sends a request using kubectl
  2. Request goes to the API Server
  3. API Server stores data in etcd
  4. Scheduler selects a node
  5. Controller Manager ensures desired state
  6. Kubelet starts containers via the runtime
  7. kube-proxy enables networking
  8. Pods become accessible through Services and Ingress

Final Thoughts

Kubernetes may seem complex at first because many components work together behind the scenes. However, every component has a clear responsibility.

Understanding these building blocks helps you:

  • Troubleshoot problems faster
  • Design scalable systems
  • Understand cluster behavior
  • Become confident with Kubernetes internals

In the next section, we can dive deeper into:

  • Pods
  • Deployments
  • Services
  • Networking
  • Storage
  • Helm
  • Kubernetes YAML
  • Production architecture
  • Security best practices