Kubernetes Basics #
Kubernetes is a control plane for running containers as reliable, declarative applications. You describe the desired state in YAML, submit it to the Kubernetes API, and controllers continuously reconcile the cluster toward that state.
Next hands-on guide: After learning these concepts, practice them in the Kubernetes Deep Dive: Minikube to AKS/EKS.
Core mental model #
- Cluster: A set of worker nodes managed by a Kubernetes control plane.
- Namespace: A logical boundary for organizing resources and applying policies.
- Pod: The smallest deployable unit, usually one application container plus optional sidecars.
- Deployment: A controller that manages stateless replicated Pods and rolling updates.
- Service: A stable virtual endpoint that routes traffic to matching Pods.
- ConfigMap and Secret: Objects for externalizing configuration and sensitive values.
First workflow to learn #
- Create or apply a Deployment.
- Expose it with a Service.
- Inspect Pods, logs, events, and rollout status.
- Change the image tag or configuration.
- Roll forward or roll back based on health checks.
kubectl create deployment demo-app --image=nginx:stable
kubectl expose deployment demo-app --port=80 --type=ClusterIP
kubectl get deployments,pods,svc
kubectl rollout status deployment/demo-app
kubectl logs deployment/demo-app
Production readiness basics #
Every workload should define:
- CPU and memory requests so the scheduler can place Pods safely.
- CPU and memory limits where they reduce noisy-neighbor risk.
- Readiness probes so traffic only reaches healthy Pods.
- Liveness probes when the app can recover from restart.
- Labels that identify app, team, environment, and ownership.
Troubleshooting commands #
kubectl describe pod <pod-name>
kubectl get events --sort-by=.lastTimestamp
kubectl logs <pod-name> --previous
kubectl exec -it <pod-name> -- sh
Use these commands to answer three questions: Was the Pod scheduled, did the container start, and is the application actually ready for traffic?
What to learn next #
- Kubernetes Networking for Services, DNS, Ingress, and traffic controls.
- Helm vs Kustomize for manifest management.
- Kubernetes Deep Dive: Minikube to AKS/EKS for a complete local-to-cloud practice path.