Home/Learn/Kubernetes/What is Kubernetes & Why Orchestration?

What is Kubernetes & Why Orchestration?

Beginner
Fundamentals

Kubernetes (K8s) is the industry-standard container orchestrator — it runs containers across a cluster of machines, handles failures, scales workloads, and manages deployments with zero downtime.

Overview

Docker runs containers on a single host. When you need to run 50 microservices across 10 servers, auto-scale on traffic, recover from node failures, and deploy new versions without downtime — you need an orchestrator. Kubernetes is that orchestrator. Originally built by Google (based on their internal Borg system) and donated to the CNCF in 2014, K8s has become the operating system of the cloud. It presents a cluster of machines as a single compute resource and lets you declare what you want running — Kubernetes figures out where and how to run it, restarts failed containers, and redistributes work when nodes fail.

The Problem Kubernetes Solves

Running containers in production across multiple hosts without an orchestrator means manual placement, manual failure recovery, manual scaling, and manual networking configuration. Kubernetes automates all of this.

Problems Kubernetes solves
Without Kubernetes (manual multi-host container management):

┌────────────────────────────────────────────────────────┐

│  Problems:                                             │

│  ❌ Which server do I deploy to?                       │

│  ❌ Server-1 dies → manually redeploy on Server-2      │

│  ❌ Traffic spike → manually start more containers     │

│  ❌ How do services find each other across servers?    │

│  ❌ Rolling update without downtime = complex scripts  │

│  ❌ Config and secrets management = per-server files   │

â””────────────────────────────────────────────────────────┘



With Kubernetes:

┌────────────────────────────────────────────────────────┐

│  Solutions:                                            │

│  ✅ Scheduler places containers on best-fit nodes      │

│  ✅ Controller restarts failed containers automatically │

│  ✅ HPA scales pods based on CPU/memory/custom metrics  │

│  ✅ Service DNS provides stable endpoint regardless    │

│     of which node the pod runs on                      │

│  ✅ Deployment manages rolling updates with zero down  │

│  ✅ ConfigMaps and Secrets manage config centrally     │

â””────────────────────────────────────────────────────────┘

Cluster Architecture

A Kubernetes cluster has a control plane (the brain) and worker nodes (where your workloads run). The control plane components manage desired state; nodes run the actual container workloads.

Kubernetes cluster architecture
┌─────────────────────────────────────────────────────────────┐

│                    CONTROL PLANE                            │

│                                                             │

│  ┌──────────────┐  ┌───────────┐  ┌──────────────────────┐ │

│  │ kube-         │  │ etcd      │  │ kube-controller-     │ │

│  │ apiserver     │  │ (cluster  │  │ manager              │ │

│  │ (REST API,    │  │  state DB)│  │ (reconcile loops)    │ │

│  │  auth gate)   │  â””───────────┘  â””──────────────────────┘ │

│  â””──────────────┘  ┌───────────────────────────────────────┐│

│                    │ kube-scheduler (assigns pods to nodes) ││

│                    â””───────────────────────────────────────┘│

â””─────────────────────────────────────────────────────────────┘

          │               │               │

    ┌─────â”´──────┐  ┌─────â”´──────┐  ┌────â”´───────┐

    │  Node-1    │  │  Node-2    │  │  Node-3    │

    │ kubelet    │  │ kubelet    │  │ kubelet    │  ← talks to API server

    │ kube-proxy │  │ kube-proxy │  │ kube-proxy │  ← networking rules

    │ containerd │  │ containerd │  │ containerd │  ← runs containers

    │            │  │            │  │            │

    │ [Pod]      │  │ [Pod][Pod] │  │ [Pod]      │

    â””────────────┘  â””────────────┘  â””────────────┘

kubectl — The Command-Line Interface

kubectl is the primary way to interact with a Kubernetes cluster. It talks to the kube-apiserver to read and modify cluster state.

bash — essential kubectl commands
# Installation and setup

# kubectl reads cluster config from ~/.kube/config

kubectl config view                    # see all configured clusters

kubectl config current-context         # which cluster are you pointing at?

kubectl config use-context prod-cluster  # switch cluster



# Core commands

kubectl get nodes                      # list cluster nodes

kubectl get pods                       # pods in current namespace

kubectl get pods -A                    # pods in ALL namespaces

kubectl get pods -n kube-system        # pods in kube-system namespace

kubectl get all                        # pods, services, deployments, etc.



# Describe (detailed info + events)

kubectl describe pod my-pod

kubectl describe node worker-1

kubectl describe deployment my-app



# Logs

kubectl logs my-pod                    # logs from a pod

kubectl logs my-pod -c my-container    # specific container in pod

kubectl logs -f my-pod                 # follow (like tail -f)

kubectl logs --previous my-pod         # logs from previous (crashed) container



# Execute commands inside a running pod

kubectl exec -it my-pod -- bash        # interactive shell

kubectl exec my-pod -- ls /app         # one-off command



# Apply and delete resources

kubectl apply -f deployment.yaml       # create or update resources

kubectl delete -f deployment.yaml      # delete resources defined in file

kubectl delete pod my-pod              # delete specific resource

Key Points to Remember

  • 1Kubernetes automates container placement, self-healing, scaling, and rolling deployments across a cluster.
  • 2Control plane (apiserver, etcd, scheduler, controllers) manages desired state.
  • 3Worker nodes run the actual workloads via kubelet + container runtime (containerd).
  • 4kubectl communicates with the kube-apiserver using config in ~/.kube/config.
  • 5etcd is the cluster's source of truth — a key-value store of all cluster state.
  • 6Kubernetes reconciliation: controllers continuously compare desired state (YAML) with actual state and fix divergence.

Interview Questions

Sign in to ask Aria
1

What is the role of etcd in Kubernetes?

2

What is the kube-scheduler responsible for?

Ask Aria about What is Kubernetes & Why Orchestration?

Your personal AI tutor — ask anything about this concept

Revision Status

Personal Notes

Sign in to save personal notes for this topic.

Discussion

Sign in to join the discussion.

Loading discussion…