What Is Kubernetes?
Kubernetes (K8s) is a container orchestration platform that automates deployment, scaling, and management of containerized applications. While it is typically associated with large-scale cloud environments, understanding its concepts is valuable for any DevOps practitioner.
Core Concepts
| Concept | Description |
|---|---|
| Pod | Smallest deployable unit — one or more containers |
| Service | Stable network endpoint for a set of pods |
| Deployment | Manages pod replicas and rolling updates |
| Namespace | Virtual cluster for isolation |
| ConfigMap | External configuration for pods |
| Secret | Sensitive data (passwords, keys) |
| Ingress | HTTP routing and SSL termination |
Lightweight K8s for VPS: K3s
K3s is a lightweight Kubernetes distribution designed for resource-constrained environments:
# Install K3s (single node)
curl -sfL https://get.k3s.io | sh -
# Check status
sudo k3s kubectl get nodes
# Deploy an app
sudo k3s kubectl create deployment nginx --image=nginx
sudo k3s kubectl expose deployment nginx --port=80 --type=NodePortWhen to Use Kubernetes
- Running 10+ containers that need orchestration
- Need automatic scaling based on load
- Require zero-downtime deployments
- Running microservices architecture
When NOT to Use Kubernetes
- Single application or simple stack
- VPS with less than 4 GB RAM
- No DevOps experience (Docker Compose is simpler)
- Small team without K8s expertise
Alternative: Docker Compose
For most VPS use cases, Docker Compose provides sufficient orchestration without the complexity of Kubernetes.