Q: Describe the pod lifecycle from `kubectl apply` to the app serving traffic.
1. API server receives the pod spec, validates it, stores it in etcd. Pod status: Pending.
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
- API server receives the pod spec, validates it, stores it in etcd. Pod status:
Pending. - kube-scheduler notices the unscheduled pod, runs filtering + scoring, writes the
nodeNameto the pod spec. - kubelet on the chosen node watches for pods assigned to it. Sees the new pod.
- kubelet calls the CRI (Container Runtime Interface — containerd/CRI-O) to pull the image.
- Init containers run sequentially to completion.
Remediation & Permanent Safeguards
Execute the resolution runbook and verify workload health:
- Main containers start.
postStartlifecycle hook runs if defined. - Liveness and readiness probes start (after
initialDelaySeconds). - Once readiness probe passes, kube-proxy adds the pod IP to the Service endpoints.
- Traffic flows to the pod.
- API server receives the pod spec, validates it, stores it in etcd. Pod status: Pending.
- kube-scheduler notices the unscheduled pod, runs filtering + scoring, writes the nodeName to the ...
- kubelet on the chosen node watches for pods assigned to it. Sees the new pod.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Enabling Horizontal Pod Autoscaler without defining baseline container CPU and memory requests HPA computes target metrics based on resource requests; omitting requests leaves HPA unable to calculate utilization percentages.
- Configuring restrictive container CPU limits that trigger severe CFS scheduler throttling Aggressive CPU limits throttle container execution cycles, causing unexpected p99 latency spikes even when total node CPU is underutilized.
- Leaving automountServiceAccountToken enabled by default on pods with no API interaction needs Automounting API tokens exposes internal cluster credentials to pods that have no operational requirement to interact with kube-apiserver.
-
Configuring StatefulSets using shared static PersistentVolumeClaims instead of volumeClaimTemplates in kubernetes-q053-describe-the-pod-lifecycle-from-kub
volumeClaimTemplatesguarantee dedicated independent storage volumes for each ordinal replica pod in stateful clusters.