Kubernetes Architecture & Concepts

25 minLesson 1 of 8

Learning Objectives

  • Understand why container orchestration is needed
  • Learn Kubernetes architecture (control plane & worker nodes)
  • Identify core Kubernetes objects
  • Install and configure kubectl and Minikube

Why Container Orchestration?

Running a single container is easy. Running hundreds across multiple servers requires orchestration.

Challenges Without Orchestration

ChallengeSolution with K8s
Container crashesAuto-restart and self-healing
Traffic spikesAuto-scaling
Server failuresRescheduling to healthy nodes
DeploymentsRolling updates, zero downtime
Service discoveryBuilt-in DNS and load balancing
ConfigurationConfigMaps and Secrets

Kubernetes Architecture

┌─────────────────────────────────────────────────────────┐
│                    Control Plane                          │
│  ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐  │
│  │API Server│ │ Scheduler │ │Controller│ │  etcd    │  │
│  │          │ │           │ │ Manager  │ │(Key-Value)│  │
│  └──────────┘ └───────────┘ └──────────┘ └──────────┘  │
└────────────────────────┬────────────────────────────────┘
                         │
         ┌───────────────┼───────────────┐
         │               │               │
┌────────▼────────┐ ┌───▼──────────┐ ┌──▼───────────┐
│   Worker Node 1 │ │ Worker Node 2│ │ Worker Node 3│
│ ┌─────┐ ┌─────┐│ │ ┌─────┐      │ │ ┌─────┐      │
│ │Pod A│ │Pod B││ │ │Pod C│      │ │ │Pod D│      │
│ └─────┘ └─────┘│ │ └─────┘      │ │ └─────┘      │
│ ┌──────────────┐│ │ ┌──────────┐ │ │ ┌──────────┐ │
│ │kubelet│kube- ││ │ │kubelet   │ │ │ │kubelet   │ │
│ │       │proxy ││ │ │kube-proxy│ │ │ │kube-proxy│ │
│ └──────────────┘│ │ └──────────┘ │ │ └──────────┘ │
└─────────────────┘ └──────────────┘ └──────────────┘

Control Plane Components

ComponentRole
API ServerFront door to the cluster — all communication goes through it
etcdDistributed key-value store for cluster state
SchedulerAssigns pods to nodes based on resources
Controller ManagerRuns controllers (ReplicaSet, Deployment, etc.)

Worker Node Components

ComponentRole
kubeletAgent that ensures containers are running in pods
kube-proxyNetwork proxy for service communication
Container RuntimeRuns containers (containerd, CRI-O)

Core Kubernetes Objects

Pods

The smallest deployable unit — one or more containers sharing network and storage.

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.25
    ports:
    - containerPort: 80

Deployments

Manage pod replicas with rolling updates and rollbacks.

Services

Expose pods to network traffic (internal or external).

Namespaces

Logical isolation within a cluster.

Installing kubectl & Minikube

kubectl (Kubernetes CLI)

# macOS
brew install kubectl
 
# Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
 
# Verify
kubectl version --client

Minikube (Local Cluster)

# macOS
brew install minikube
 
# Linux
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
 
# Start a cluster
minikube start --driver=docker
 
# Verify
kubectl cluster-info
kubectl get nodes

Essential kubectl Commands

# Cluster info
kubectl cluster-info
kubectl get nodes
 
# Namespaces
kubectl get namespaces
kubectl create namespace dev
 
# View resources
kubectl get pods
kubectl get pods -A              # All namespaces
kubectl get deployments
kubectl get services
 
# Describe a resource
kubectl describe pod nginx-pod
 
# Logs
kubectl logs nginx-pod
kubectl logs -f nginx-pod        # Follow logs
 
# Execute into a pod
kubectl exec -it nginx-pod -- /bin/bash

Declarative vs Imperative

# Imperative (quick, not reproducible)
kubectl run nginx --image=nginx:1.25
kubectl expose pod nginx --port=80
 
# Declarative (recommended, version-controlled)
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml

Always prefer declarative YAML manifests for production workloads.

Summary

You've learned:

  • Why container orchestration is essential at scale
  • Kubernetes architecture (control plane + worker nodes)
  • Core objects: Pods, Deployments, Services, Namespaces
  • How to install kubectl and Minikube
  • Imperative vs declarative approaches

Next Steps

Next, we'll create Pods and Deployments to run applications on Kubernetes.