Kubernetes for Beginners: Deploy, Scale & Manage Containers in 2026
Learn Kubernetes from scratch — pods, deployments, services, ingress, ConfigMaps, and scaling. A practical guide with real examples to get your first app running on K8s.
What Is Kubernetes?
Kubernetes (K8s) is a container orchestration platform. If Docker is how you package your app, Kubernetes is how you run it in production — handling deployment, scaling, networking, and self-healing automatically.
The problem Kubernetes solves:
- You have 50 containers across 10 servers — who decides which container runs where?
- A container crashes at 3 AM — who restarts it?
- Traffic spikes 10x — who spins up more instances?
- You deploy a bad version — who rolls it back?
Kubernetes handles all of this.
Without K8s: You manually manage containers on servers
With K8s: You describe what you want, K8s makes it happen
Core Concepts
The Hierarchy
Cluster
└── Nodes (physical/virtual machines)
└── Pods (smallest deployable unit)
└── Containers (your app)
Key Resources
| Resource | What It Does | |----------|-------------| | Pod | Runs one or more containers together | | Deployment | Manages pods — scaling, updates, rollbacks | | Service | Stable network endpoint for pods | | Ingress | Routes external HTTP traffic to services | | ConfigMap | Stores configuration (env vars, files) | | Secret | Stores sensitive data (passwords, tokens) | | Namespace | Virtual cluster for isolation |
Setting Up
Local Development
Install kubectl
Your First Deployment
Step 1: Create a Deployment
Output:
NAME READY UP-TO-DATE AVAILABLE AGE
my-app 3/3 3 3 30s
NAME READY STATUS RESTARTS AGE
my-app-6d8f7b4d5-abc12 1/1 Running 0 30s
my-app-6d8f7b4d5-def34 1/1 Running 0 30s
my-app-6d8f7b4d5-ghi56 1/1 Running 0 30s
Step 2: Expose with a Service
Step 3: Expose Externally
Scaling
Manual Scaling
Auto-Scaling (HPA)
Configuration
ConfigMaps (Non-Sensitive Data)
Secrets (Sensitive Data)
Using Config in Pods
Ingress (HTTP Routing)
Ingress routes external HTTP/HTTPS traffic to services based on hostname or path.
Rolling Updates and Rollbacks
Update Image
Output:
Waiting for deployment "my-app" rollout to finish: 1 out of 3 new replicas have been updated...
Waiting for deployment "my-app" rollout to finish: 2 out of 3 new replicas have been updated...
deployment "my-app" successfully rolled out
Rollback
Rolling Update Strategy
Debugging
Essential Commands
Common Issues
| Symptom | Check | Fix |
|---------|-------|-----|
| CrashLoopBackOff | kubectl logs <pod> | Fix app crash, check env vars |
| ImagePullBackOff | kubectl describe pod | Fix image name, check registry auth |
| Pending | kubectl describe pod | Check resources, node capacity |
| 0/1 Running | Readiness probe | Fix health check endpoint |
Health Checks
Namespaces
Quick Reference: kubectl Commands
What's Next?
Once you're comfortable with the basics:
- Helm — Package manager for Kubernetes (charts = reusable templates)
- Kustomize — Customize YAML without templates
- ArgoCD — GitOps continuous deployment
- Prometheus + Grafana — Monitoring and dashboards
- Istio / Linkerd — Service mesh for advanced networking
- Cert-Manager — Automatic TLS certificates
The key insight: Kubernetes is declarative. You tell it what you want (3 replicas, 80% CPU limit, rolling updates), and it figures out how to make it happen. Start simple, add complexity only when you need it.