← Back to Home
☸️

Introduction to Kubernetes

The system that runs containers across many machines, and heals itself when things break.

10 min read📚DevOps Fundamentals

Docker is great for running containers on one machine. But production needs hundreds of containers across many machines, restarted automatically when they crash and scaled up when traffic spikes. Kubernetes (often written K8s) is the system that manages all of that for you.


🎯 Learning Objectives

By the end of this lesson you will:


The Problem Kubernetes Solves

Imagine running 200 containers by hand. You’d have to:

Kubernetes automates all of this. You tell it the desired state — “I want 5 copies of this app running” — and it makes reality match, continuously.

💡 Declarative, not imperative

You don’t tell Kubernetes how to do things step by step. You describe the desired state, and Kubernetes constantly works to keep the cluster in that state. This is the single most important idea in K8s.


The Big Picture: a Cluster

A Kubernetes cluster is a set of machines (nodes) working together, split into two roles:

Part Role
Control plane The brain — makes decisions, schedules work, watches state
Worker nodes The muscle — actually run your containers
text
        ┌──────────── Control Plane ────────────┐
      │  API Server · Scheduler · Controller   │
      │  etcd (the cluster's memory)           │
      └───────────────────┬────────────────────┘
                          │ commands
      ┌───────────┬───────┴───────┬────────────┐
    Node 1       Node 2         Node 3
  [Pods...]     [Pods...]      [Pods...]

Key Components

Control plane:

Worker nodes:


The Pod — the Smallest Unit

You don’t deploy containers directly in Kubernetes — you deploy Pods. A Pod wraps one (occasionally more) container and is the smallest thing Kubernetes schedules.

💡 Pods are cattle, not pets

Pods are disposable. If one dies, Kubernetes doesn’t nurse it back to health — it throws it away and creates a fresh one. Your app must be designed to handle this, which is what makes it resilient.


See It Yourself

kubectl is the command-line tool for talking to a cluster:

bash
kubectl version --short     # client + server versions
kubectl get nodes           # list the machines in the cluster
kubectl get pods -A         # all pods across all namespaces
bash — 80×24
student@devops:~$kubectl get nodes

Here the cluster has one control-plane node and two workers, all Ready.


🧪 Hands-on Lab

📝

Explore a Cluster

  1. List the nodes in the cluster and note their roles
  2. List all pods across every namespace
  3. Describe one node to see its capacity (CPU, memory)

🧠 Knowledge Check

Knowledge Check

What is the smallest deployable unit in Kubernetes?

Knowledge Check

What does 'declarative configuration' mean in Kubernetes?


💼 Interview Preparation

Interview Q&A

What problems does Kubernetes solve that Docker alone does not?


Summary

You now understand what Kubernetes is, the control plane vs worker node split, the core components, and the declarative model built around Pods. Next, you’ll actually run an app using Pods and Deployments.

Up Next

Pods & Deployments

You've mastered this lesson. Continue your journey to becoming a DevOps Engineer.

Start Next Lesson