What is Kubernetes (K8s)?
Core Idea
Kubernetes (K8s) is a container orchestration system that automatically deploys, scales, and manages containerized applications (like
[[Docker]]containers).💡 Memory Trick:
[[Docker]]= runs containers | Kubernetes = manages containers at scale.
🧩 The Problem it Solves
Before K8s, managing standalone containers at an enterprise level caused massive operational overhead:
- ❌ Manual deployments.
- ❌ No auto-scaling during traffic spikes.
- ❌ No self-healing (if a container crashed, it stayed dead).
- ❌ Complex networking and manual load balancing.
👉 Kubernetes solves all of this by automating the operational lifecycle.
🏗️ High-Level Architecture
A Kubernetes [[Cluster]] is divided into two primary components:
- Control Plane (The Brain 🧠):
- Makes global cluster decisions.
- Schedules workloads.
- Constantly monitors and maintains the desired state.
- Worker Nodes (The Execution 💪):
- The actual machines (VMs or physical servers) that run your applications.
⚙️ Key Capabilities
- Container Orchestration: Runs and manages containers across multiple disparate machines as if they were one unified system.
- Auto-Scaling: Automatically scales workloads up or down based on CPU, memory, or custom metrics.
- Self-Healing: If a
[[Pod]]dies, K8s automatically restarts or replaces it. - Load Balancing: Distributes incoming network traffic safely across available, healthy Pods.
- Rolling Updates: Enables seamless, zero-downtime deployments when pushing new versions of an app.
🧠 Core Terminology
- Cluster: The entire system/ecosystem working together.
- Node: A single worker machine within the cluster.
- Pod: The smallest, most basic deployable unit in Kubernetes.
- Container: The actual application running inside the Pod.
💡 Insights & Real-World Application
Real-World DevOps Example
Imagine deploying a Machine Learning model (e.g., via SageMaker):
- Without K8s: You rely on 1 server. If it crashes, your app goes down entirely.
- With K8s: You declare that you want 3 pods running. If 1 crashes, K8s automatically replaces it and instantly shifts traffic to the healthy pods. This ensures production-grade reliability.
The Interview Answer
“Kubernetes is a container orchestration platform that automates the deployment, scaling, networking, and self-healing of containerized applications across a cluster of machines.”
CKA Concept: The Desired State
K8s fundamentally works on a declarative Desired State. You write a configuration file declaring, “I want 3 pods running.” K8s acts as an active control loop, continuously monitoring the cluster to ensure it always matches that declaration, no matter what underlying hardware fails.