What is Kubernetes?

Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications.

Kubernetes (often shortened to K8s — the 8 stands for the eight letters between K and s) is an open-source platform for running containers across many machines as if they were one big computer.

Why containers need help

A container packages your app with everything it needs to run. That works great on one machine, but real systems have dozens or thousands of containers spread over many servers. Someone has to decide where each container runs, restart the ones that crash, and add more when traffic grows.

Kubernetes is that someone. You tell it the desired state ("run 3 copies of my web app") and it constantly works to make reality match.

What Kubernetes does for you

  • Scheduling — places containers on the best available machine.
  • Self-healing — restarts failed containers and replaces dead ones.
  • Scaling — adds or removes copies based on load.
  • Service discovery — gives your apps stable names and load balancing.
  • Rollouts & rollbacks — ships new versions safely and reverses bad ones.

Example

Example · bash
# Check that the kubectl command-line tool is installed
kubectl version --client

# The output shows the client version, e.g.:
# Client Version: v1.30.0

When to use it

  • A startup deploys its web application to Kubernetes so it can automatically restart crashed containers without manual intervention.
  • An e-commerce platform uses Kubernetes to run dozens of microservices, each scaled independently based on traffic demand.
  • A SaaS company manages rolling upgrades of their API service on Kubernetes, achieving zero-downtime deployments.

More examples

Verify cluster info and nodes

Confirms the control plane URL and lists all registered worker nodes to verify the cluster is healthy.

Example · bash
kubectl cluster-info
kubectl get nodes

Run a simple nginx pod

Creates a single Pod running the official nginx image and then lists running pods to confirm it started.

Example · bash
kubectl run nginx --image=nginx:1.25 --port=80
kubectl get pods

Minimal Kubernetes Pod manifest

Declares the minimal required fields to define a pod: apiVersion, kind, metadata name, and a container image.

Example · yaml
apiVersion: v1
kind: Pod
metadata:
  name: hello-k8s
spec:
  containers:
    - name: web
      image: nginx:1.25
      ports:
        - containerPort: 80

Discussion

  • Be the first to comment on this lesson.
What is Kubernetes? — Kubernetes | SoundsCode