Kubernetes Pods & Services
Objective
Deep-dive into Pod specifications and Service types.
Tools & Technologies
kubectlYAML manifestsServices
Key Commands
kubectl run nginx --image=nginx --port=80kubectl expose pod nginx --type=NodePortkubectl port-forward pod/nginx 8080:80kubectl get svc -o yamlLab Steps
01
Pod Spec
Write Pod YAML with containers, resources, and environment variables.
02
Resource Limits
Set CPU and memory requests and limits on containers.
03
Liveness & Readiness
Configure liveness and readiness probes.
04
Service Types
Understand ClusterIP, NodePort, LoadBalancer, and ExternalName.
Challenges Encountered
- Pods without resource limits can starve other workloads
- Readiness probe failure removes pod from service endpoints
Key Takeaways
- Always set resource requests and limits in production
- Readiness probes are essential for zero-downtime deployments