What is Kubernetes? Container Orchestration Explained

Running a single Docker container on your laptop is straightforward. Running 50 different services across 20 servers, with automatic failover, rolling deployments, and traffic-based autoscaling -- that is where Kubernetes comes in.

Kubernetes (abbreviated K8s) was open-sourced by Google in 2014, based on their internal system called Borg. It has since become the de facto standard for container orchestration in production, maintained by the Cloud Native Computing Foundation (CNCF). Every major cloud provider offers a managed Kubernetes service: Amazon EKS, Google GKE, and Azure AKS.

The Problem Kubernetes Solves

When you move beyond a few containers, manual management breaks down quickly. You need to answer questions like: which server has enough CPU to run this container? What happens when a server goes down? How do you deploy a new version of your app without dropping user traffic? How do you scale from 2 containers to 20 when load spikes?

Kubernetes answers all of these automatically. It treats your cluster of machines as a single pool of compute resources and makes decisions about placement, health, and scaling on your behalf.

Core Concepts

Pods

A pod is the smallest unit Kubernetes manages. It wraps one or more containers that share a network namespace, meaning they can reach each other on localhost. Most pods run a single container. Kubernetes does not manage containers directly -- it manages pods.

Deployments

You rarely create pods by hand. Instead, you create a Deployment, which declares your desired state: "run 3 replicas of this container image." Kubernetes continuously reconciles actual state toward that desired state. If a pod crashes, the Deployment controller creates a replacement.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api-server
  template:
    metadata:
      labels:
        app: api-server
    spec:
      containers:
        - name: api
          image: 123456789.dkr.ecr.us-east-1.amazonaws.com/myapp:v1.4.2
          ports:
            - containerPort: 3000
          resources:
            requests:
              cpu: "100m"
              memory: "128Mi"
            limits:
              cpu: "500m"
              memory: "512Mi"

The resources block is not optional in production. Without CPU and memory limits, a misbehaving container can starve other workloads on the same node.

Services

Pods have dynamic IP addresses -- they are replaced whenever they restart. A Service provides a stable virtual IP and DNS name that routes traffic to the correct pods, regardless of which specific pods are running at any moment. There are three common Service types: ClusterIP (internal only), NodePort (accessible on each node's IP), and LoadBalancer (provisions a cloud load balancer).

Namespaces

Namespaces provide logical isolation within a single cluster. You might have a production namespace, a staging namespace, and a monitoring namespace. Resource quotas and RBAC policies can be scoped per namespace.

How the Control Plane Works

A Kubernetes cluster has two roles: control plane nodes and worker nodes.

The control plane runs four core components. The API server is the single entry point -- every kubectl command, every controller, every admission webhook talks to it. etcd is a distributed key-value store that holds the entire cluster state. The scheduler assigns pods to worker nodes based on resource availability and constraints. The controller manager runs reconciliation loops: checking that the actual state matches the desired state.

Worker nodes run the kubelet (an agent that receives pod specs and manages containers), the kube-proxy (handles Service networking), and a container runtime (usually containerd).

Deploying and Managing Workloads

The primary CLI tool is kubectl. The commands you use most in day-to-day work:

# Apply a YAML manifest
kubectl apply -f deployment.yaml

# Watch pod status in real time
kubectl get pods -w

# Stream logs from a pod
kubectl logs -f deploy/api-server

# Open a shell inside a running container
kubectl exec -it <pod-name> -- /bin/sh

# Describe a pod to see events and conditions
kubectl describe pod <pod-name>

# Scale a deployment
kubectl scale deployment api-server --replicas=5

Kubernetes in a DevOps Pipeline

Kubernetes does not replace your CI/CD guide pipeline -- it sits at the end of it. A typical flow: a developer pushes code, CI builds and tests a Docker image, pushes it to a registry, and then applies a new manifest to the cluster (or an ArgoCD sync picks it up automatically via GitOps).

Tools like Helm are widely used to template and package Kubernetes manifests for reuse across environments. For a full walkthrough of standing up a production cluster, see the Kubernetes guide for beginners.

Why Every DevOps Engineer Needs to Know K8s

Kubernetes is not optional knowledge anymore. Job postings for senior DevOps and platform engineering roles almost universally list K8s as required. More importantly, understanding it deeply -- not just running kubectl apply -- means you can design resilient systems, debug live incidents, and build self-service internal platforms. Those are the skills that differentiate a mid-level engineer from a senior one.

Frequently Asked Questions