Skip to main content

Chapter 1.4 - High-Level Architecture

Learning Objectives

By the end of this chapter, you will be able to:

  • Understand the structure of a Kubernetes cluster
  • Identify Control Plane components
  • Identify Worker Node components
  • Understand communication between components

Introduction

A Kubernetes cluster is composed of machines organized into two main groups: the Control Plane (formerly Master) and the Worker Nodes. Understanding this architecture is essential to mastering Kubernetes.


Cluster Overview

Basic Structure

Two types of machines:

  1. Control Plane: Makes decisions and manages state
  2. Worker Nodes: Run the applications

The Control Plane (Master)

Primary Role

The Control Plane is the "brain" of the cluster:

Responsibilities:

  • Manage the desired state of the cluster
  • Make deployment decisions
  • Coordinate Worker Nodes
  • Expose the Kubernetes API

Control Plane Components

1. API Server

Role: Single entry point for all interactions

Features:

  • Validates and processes all requests
  • Exposes the Kubernetes REST API
  • Authentication and authorization
  • Rate limiting

2. etcd

Role: Distributed database - Source of truth

Characteristics:

  • Distributed key-value database
  • Stores ALL cluster state
  • Single source of truth
  • High availability (multiple instances)

Important: etcd is critical - losing it = losing the cluster!

3. Controller Manager

Role: Runs the control loops

Controllers included:

  • Deployment Controller
  • ReplicaSet Controller
  • Service Controller
  • Node Controller
  • And many more...

Principle: Monitors desired state vs actual state and takes corrective actions

4. Scheduler

Role: Decides on which node to place new Pods

Selection criteria:

  • Available resources (CPU, RAM)
  • Constraints (affinity, anti-affinity)
  • Load balancing
  • Placement policies

Worker Nodes

Primary Role

Worker Nodes run the applications:

Worker Node Components

1. kubelet

Role: Agent that communicates with the API Server

Features:

  • Receives instructions from the API Server
  • Manages Pods on the node
  • Monitors container health
  • Reports state to the Control Plane

2. kube-proxy

Role: Manages networking at the node level

Features:

  • Implements Services (load balancing)
  • Manages network rules
  • Routes traffic to Pods
  • Network Policies

3. Container Runtime

Role: Runs the containers

Supported runtimes:

  • Docker (deprecated but still used)
  • containerd (recommended)
  • CRI-O (lightweight)

Interface: CRI (Container Runtime Interface)


Communication Within the Cluster

Communication Flow

API Server ↔ Nodes Communication

Protocol: HTTPS (secure) Direction: Bidirectional

  • API Server -> Nodes: Instructions
  • Nodes -> API Server: State reports

High Availability

Control Plane HA

For production, the Control Plane must be highly available:

Recommendation: Minimum 3 instances for quorum


Chapter Summary

In this chapter, you learned:

Cluster = Control Plane + Worker Nodes
Control Plane: API Server, etcd, Controller Manager, Scheduler
Worker Nodes: kubelet, kube-proxy, Container Runtime
API Server: Single entry point
etcd: State database
kubelet: Agent on each node
Communication: HTTPS between all components


Next Steps

Now that you understand the architecture:

Chapter 1.5: Fundamental Concepts (Pods, Services, etc.)
Lab 1.1: First Deployment


Chapter created: December 2024