Objective

Deep-dive into Pod specifications and Service types.

Tools & Technologies

  • kubectl
  • YAML manifests
  • Services

Key Commands

kubectl run nginx --image=nginx --port=80
kubectl expose pod nginx --type=NodePort
kubectl port-forward pod/nginx 8080:80
kubectl get svc -o yaml

Lab 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