Kubernetes Fundamentals¶
Kubernetes orchestrates containers across a cluster with automation for deployment, scaling, and recovery.
Core Concepts¶
Cluster: Control plane + worker nodes.Pod: Smallest deployable unit (one or more containers).Deployment: Declarative rollout and replica management.Service: Stable networking endpoint for pods.ConfigMapandSecret: Externalized app configuration.Namespace: Logical isolation inside a cluster.
Basic Workflow¶
- Package app as a container image.
- Define manifests (
Deployment,Service). - Apply manifests with
kubectl apply. - Observe rollout and pod health.
- Scale/update declaratively.
Essential Commands¶
kubectl get nodes
kubectl get pods -A
kubectl apply -f deployment.yaml
kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl rollout status deployment/<name>
Best Practices¶
- Use readiness/liveness probes.
- Set CPU and memory requests/limits.
- Store sensitive data in
Secretobjects. - Use namespaces and RBAC for access control.
- Prefer rolling updates with rollback strategy.