Kubernetes for Beginners: Pods, Deployments, and Services
Kubernetes for Beginners: Pods, Deployments, and Services
Kubernetes (K8s) has a reputation for complexity, but the core mental model is simple: you describe the state you want, and Kubernetes continuously works to make reality match it. Let's cover the three objects you'll use every day.
Table of Contents
- Pods: the smallest unit
- Deployments: keeping N copies alive
- Services: a stable address
- Essential kubectl commands
- How to learn without drowning
Pods: the smallest unit
A Pod is one or more containers that share a network and storage. You almost never create Pods directly — they're managed by higher-level objects. Think of a Pod as the atom of Kubernetes: indivisible, ephemeral, disposable.
Deployments: keeping N copies alive
A Deployment declares: "run 3 replicas of this image." If a Pod dies, Kubernetes replaces it. If you change the image tag, it performs a rolling update — gradually swapping old Pods for new ones with no downtime.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:1.27
ports:
- containerPort: 80
Services: a stable address
Pods come and go and their IPs change. A Service gives a set of Pods a stable DNS name and virtual IP. Other apps just call web:80 and Kubernetes load-balances across healthy Pods.
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 80
Essential kubectl commands
kubectl get pods # what's running
kubectl logs deploy/web # stream logs
kubectl describe pod <name> # why is it broken?
kubectl rollout status deploy/web
kubectl rollout undo deploy/web # instant rollback
How to learn without drowning
- Start with kind or minikube locally — no cloud bill needed.
- Master Deployments and Services before touching Ingress, ConfigMaps, or Helm.
- Always set resources.requests and resources.limits — unbounded Pods are the #1 cause of noisy-neighbor incidents.
- Add a readinessProbe early; without it, traffic hits Pods before they're ready.
Kubernetes rewards incremental learning. Get one Deployment healthy end-to-end, and everything else builds on that.
Related Articles
- Kubernetes Ingress and TLS: Exposing Services Properly
- The Complete kubectl Cheat Sheet: Every Command That Matters
Last Updated: October 2026 Author: CloudOpsGuide Team Difficulty: Beginner Estimated Reading Time: 12 minutes