Introduction to Kubernetes
1 views
Introduction to Kubernetes
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
Why Kubernetes?
- Scaling: Scale apps up or down based on load.
- Self-healing: Restarts failed containers, replaces unhealthy nodes.
- Declarative: Describe desired state; K8s reconciles the actual state.
- Portable: Runs on cloud or on-prem; same manifests work everywhere.
Core concepts
- Pod: Smallest deployable unit; one or more containers that share storage and network.
- Deployment: Manages a set of identical pods; handles rolling updates and rollbacks.
- Service: Stable network endpoint to access pods (ClusterIP, NodePort, LoadBalancer).
- Namespace: Virtual cluster for grouping resources (e.g.
production,staging).
Quick start (minikube)
minikube start
kubectl run nginx --image=nginx --port=80
kubectl expose pod nginx --port=80 --type=NodePort
kubectl get pods,svc
Useful commands
| Command | Description |
|---|---|
kubectl get pods | List pods |
kubectl describe pod <name> | Pod details |
kubectl logs <pod> | Container logs |
kubectl apply -f deploy.yaml | Apply a manifest |
Learn more at kubernetes.io/docs.