{"id":3443,"date":"2026-11-24T14:17:11","date_gmt":"2026-11-24T14:17:11","guid":{"rendered":"https:\/\/www.rajeshkumar.xyz\/blog\/?p=3443"},"modified":"2026-11-24T14:18:38","modified_gmt":"2026-11-24T14:18:38","slug":"production-kubernetes-troubleshooting-a-practical-30-minute-triage-runbook","status":"publish","type":"post","link":"https:\/\/www.rajeshkumar.xyz\/blog\/production-kubernetes-troubleshooting-a-practical-30-minute-triage-runbook\/","title":{"rendered":"Production Kubernetes Troubleshooting: A Practical 30-Minute Triage Runbook"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1-1024x576.png\" alt=\"\" class=\"wp-image-3446\" srcset=\"https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1-1024x576.png 1024w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1-300x169.png 300w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1-768x432.png 768w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1-1536x864.png 1536w, https:\/\/www.rajeshkumar.xyz\/blog\/wp-content\/uploads\/2026\/11\/389edd14-b0be-4911-8b77-20bba9938cc1.png 1672w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A production Kubernetes incident can affect customers within seconds. A failing Pod, exhausted node, broken Service, or incorrect deployment can interrupt an entire application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The challenge is not simply finding an error. It is identifying the real cause without making the incident worse.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A structured troubleshooting process helps engineers investigate problems quickly. It also reduces unnecessary restarts, risky configuration changes, and repeated debugging.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide introduces a practical 30-minute Kubernetes troubleshooting runbook. It explains what to check, which commands to execute, how to interpret results, and when to escalate an incident.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is a Kubernetes Production Troubleshooting Runbook?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Kubernetes troubleshooting runbook is a documented process for identifying, investigating, and resolving problems in a Kubernetes cluster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It gives engineers a consistent approach during production incidents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of running random commands, engineers follow a logical investigation process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A useful runbook covers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cluster and node health.<\/li>\n\n\n\n<li>Pod status and restart counts.<\/li>\n\n\n\n<li>Container logs.<\/li>\n\n\n\n<li>Kubernetes events.<\/li>\n\n\n\n<li>CPU and memory consumption.<\/li>\n\n\n\n<li>Deployment and ReplicaSet health.<\/li>\n\n\n\n<li>Service connectivity.<\/li>\n\n\n\n<li>DNS resolution.<\/li>\n\n\n\n<li>Application health checks.<\/li>\n\n\n\n<li>Recovery validation.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The objective is to restore service safely while collecting enough evidence to identify the underlying problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The 30-Minute Kubernetes Troubleshooting Framework<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following framework divides the investigation into six stages.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Time<\/th><th>Investigation<\/th><th>Main Objective<\/th><\/tr><tr><td>0\u20135 minutes<\/td><td>Cluster health<\/td><td>Identify cluster-wide failures<\/td><\/tr><tr><td>5\u201310 minutes<\/td><td>Pod investigation<\/td><td>Find failing or restarting Pods<\/td><\/tr><tr><td>10\u201315 minutes<\/td><td>Logs and events<\/td><td>Identify application and Kubernetes errors<\/td><\/tr><tr><td>15\u201320 minutes<\/td><td>Resource investigation<\/td><td>Detect CPU and memory problems<\/td><\/tr><tr><td>20\u201325 minutes<\/td><td>Networking<\/td><td>Investigate Services, endpoints, and DNS<\/td><\/tr><tr><td>25\u201330 minutes<\/td><td>Recovery validation<\/td><td>Confirm application health<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This is an operational target, not a guarantee that every incident can be resolved within 30 minutes. Complex infrastructure failures require deeper investigation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Prepare Your Kubernetes Troubleshooting Environment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before investigating production issues, verify that kubectl can communicate with the intended cluster.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Check kubectl availability<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl version --client<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">This displays the installed kubectl client version.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Identify the active cluster<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl config current-context<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check the available contexts:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl config <span class=\"hljs-keyword\">get<\/span>-contexts<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">A wrong Kubernetes context can cause engineers to investigate or modify the wrong environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Check API server connectivity<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl cluster-info<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If the command fails, investigate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API server availability.<\/li>\n\n\n\n<li>Network connectivity.<\/li>\n\n\n\n<li>Authentication credentials.<\/li>\n\n\n\n<li>Authorization permissions.<\/li>\n\n\n\n<li>Current kubeconfig configuration.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Define your production namespace<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">export<\/span> NS=production<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Verify that the namespace exists:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> namespaces<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Confirm the cluster context and namespace before running any production-changing command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Minutes 0\u20135: Check Overall Cluster Health<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the cluster rather than focusing immediately on one application Pod.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A production application can fail because of a broader infrastructure problem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check Kubernetes nodes<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> nodes -o wide<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Look at the STATUS column.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common node conditions include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ready<\/li>\n\n\n\n<li>NotReady<\/li>\n\n\n\n<li>Unknown<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A NotReady node may affect every workload scheduled on that machine.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Describe an unhealthy node<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl describe node NODE_NAME<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Replace <code>NODE_NAME<\/code> with the actual node name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Conditions<\/li>\n\n\n\n<li>Capacity<\/li>\n\n\n\n<li>Allocatable resources<\/li>\n\n\n\n<li>MemoryPressure<\/li>\n\n\n\n<li>DiskPressure<\/li>\n\n\n\n<li>PIDPressure<\/li>\n\n\n\n<li>Taints<\/li>\n\n\n\n<li>Recent events<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A node with DiskPressure may have insufficient available disk space.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A node with MemoryPressure may be experiencing memory exhaustion.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check system workloads<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n kube-system -o wide<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Pay attention to important infrastructure components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CoreDNS<\/li>\n\n\n\n<li>kube-proxy, where deployed<\/li>\n\n\n\n<li>CNI networking components<\/li>\n\n\n\n<li>CSI storage components<\/li>\n\n\n\n<li>Cluster monitoring agents<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The exact components depend on the cluster distribution and architecture.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check recent cluster events<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> events -A --sort-by=.metadata.creationTimestamp<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Look for repeated warnings involving:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FailedScheduling<\/li>\n\n\n\n<li>FailedMount<\/li>\n\n\n\n<li>FailedAttachVolume<\/li>\n\n\n\n<li>FailedCreatePodSandBox<\/li>\n\n\n\n<li>BackOff<\/li>\n\n\n\n<li>Unhealthy<\/li>\n\n\n\n<li>NodeNotReady<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What should you conclude?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If several applications fail simultaneously, investigate shared infrastructure before changing individual workloads.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Minutes 5\u201310: Identify Failing Kubernetes Pods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Pods are the next investigation point.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n $NS -o wide<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">This displays Pod status, restart counts, node placement, and IP addresses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understand common Pod statuses<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Status<\/th><th>Possible Meaning<\/th><\/tr><tr><td>Pending<\/td><td>Pod is waiting for scheduling or another dependency<\/td><\/tr><tr><td>Running<\/td><td>Pod containers are running<\/td><\/tr><tr><td>CrashLoopBackOff<\/td><td>A container repeatedly exits<\/td><\/tr><tr><td>ImagePullBackOff<\/td><td>Kubernetes cannot pull the container image<\/td><\/tr><tr><td>ErrImagePull<\/td><td>Image retrieval failed<\/td><\/tr><tr><td>CreateContainerConfigError<\/td><td>Container configuration problem<\/td><\/tr><tr><td>ContainerCreating<\/td><td>Container setup is still in progress<\/td><\/tr><tr><td>OOMKilled<\/td><td>Container was terminated after exceeding its memory limit<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A Running Pod is not automatically a healthy application. Check readiness and application responses too.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Investigate a failing Pod<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe pod POD_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Replace <code>POD_NAME<\/code> with the actual Pod name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Important fields include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>State<\/li>\n\n\n\n<li>Last State<\/li>\n\n\n\n<li>Restart Count<\/li>\n\n\n\n<li>Ready<\/li>\n\n\n\n<li>Conditions<\/li>\n\n\n\n<li>Events<\/li>\n\n\n\n<li>Container ID<\/li>\n\n\n\n<li>Image<\/li>\n\n\n\n<li>Exit Code<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Troubleshoot CrashLoopBackOff<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">CrashLoopBackOff means Kubernetes is repeatedly attempting to restart a container that exits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First inspect its current logs:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For the previous container instance:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS --previous<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check the container&#8217;s last termination state:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pod POD_NAME -n $NS -o jsonpath='{.status.containerStatuses&#91;*].lastState.terminated}<span class=\"hljs-string\">'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Common causes include:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Application startup failures.<\/li>\n\n\n\n<li>Missing environment variables.<\/li>\n\n\n\n<li>Invalid configuration files.<\/li>\n\n\n\n<li>Incorrect database credentials.<\/li>\n\n\n\n<li>Missing dependencies.<\/li>\n\n\n\n<li>Permission problems.<\/li>\n\n\n\n<li>Memory exhaustion.<\/li>\n\n\n\n<li>Incorrect container commands.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Do not automatically delete a failing Pod. First collect its logs and events.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Troubleshoot ImagePullBackOff<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect the Pod:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe pod POD_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Image name.<\/li>\n\n\n\n<li>Image tag.<\/li>\n\n\n\n<li>Registry availability.<\/li>\n\n\n\n<li>Image pull secrets.<\/li>\n\n\n\n<li>Registry authentication.<\/li>\n\n\n\n<li>Network connectivity.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For private registries, verify the imagePullSecrets configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An incorrect image tag can produce an image-pulling failure even when the application configuration is correct.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Minutes 10\u201315: Analyze Container Logs and Kubernetes Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Logs provide application-level information. Events provide information about Kubernetes operations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need both to understand an incident.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check container logs<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS --tail=<span class=\"hljs-number\">100<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Follow logs continuously:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS -f<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For a Pod containing multiple containers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS -c CONTAINER_NAME<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For previously terminated containers:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS -c CONTAINER_NAME --previous<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Search for common application errors<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs POD_NAME -n $NS --tail=<span class=\"hljs-number\">500<\/span> | grep -Ei <span class=\"hljs-string\">\"error|exception|failed|timeout|refused\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Possible application errors include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Database connection refused.<\/li>\n\n\n\n<li>Authentication failure.<\/li>\n\n\n\n<li>Connection timeout.<\/li>\n\n\n\n<li>Missing configuration.<\/li>\n\n\n\n<li>Failed dependency initialization.<\/li>\n\n\n\n<li>Application startup exception.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that logs may contain sensitive information. Avoid sharing credentials, tokens, or customer data during troubleshooting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Investigate Kubernetes events<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-18\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> events -n $NS --sort-by=.metadata.creationTimestamp<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-18\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For detailed Pod events:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-19\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe pod POD_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-19\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Typical findings:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>FailedScheduling<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The scheduler cannot place the Pod on an available node.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Possible reasons include insufficient CPU, insufficient memory, node selectors, taints, or affinity requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>FailedMount<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kubernetes cannot mount a required volume.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Investigate PersistentVolumeClaims, storage classes, CSI components, and permissions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Unhealthy<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A container health probe has failed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the readiness, liveness, and startup probe configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>BackOff<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kubernetes is delaying another attempt after repeated failures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Investigate the original failure instead of treating BackOff as the root cause.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Minutes 15\u201320: Investigate CPU and Memory Problems<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Resource exhaustion can make an application slow, unstable, or unavailable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check Pod resource consumption<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-20\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl top pods -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-20\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check all namespaces:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl top pods -A<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Check node resource consumption<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl top nodes<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">These commands require a working Metrics Server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Their measurements provide recent resource consumption, not a complete historical performance investigation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Investigate OOMKilled containers<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-21\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe pod POD_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-21\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Look for:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-22\" data-shcb-language-name=\"HTTP\" data-shcb-language-slug=\"http\"><span><code class=\"hljs language-http\"><span class=\"hljs-attribute\">Reason<\/span>: OOMKilled<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-22\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTTP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">http<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">An OOMKilled container has exceeded its available memory under the applicable memory enforcement limits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect its resource configuration:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-23\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> deployment DEPLOYMENT_NAME -n $NS -o yaml<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-23\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Look for:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-24\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">resources:\n  requests:\n    memory: <span class=\"hljs-string\">\"256Mi\"<\/span>\n    <span class=\"hljs-attr\">cpu<\/span>: <span class=\"hljs-string\">\"250m\"<\/span>\n  <span class=\"hljs-attr\">limits<\/span>:\n    memory: <span class=\"hljs-string\">\"512Mi\"<\/span>\n    <span class=\"hljs-attr\">cpu<\/span>: <span class=\"hljs-string\">\"500m\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-24\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">These values are illustrative. Actual resource settings should reflect measured application requirements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understand CPU throttling<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A container can remain Running while experiencing CPU throttling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This can cause:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Increased response times.<\/li>\n\n\n\n<li>Slow background processing.<\/li>\n\n\n\n<li>Request timeouts.<\/li>\n\n\n\n<li>Delayed application initialization.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect CPU usage, configured limits, and monitoring data together.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Review scheduling capacity<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">kubectl describe node NODE_NAME<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check allocated resources and node conditions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that scheduling uses resource requests, while CPU and memory limits affect runtime resource enforcement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Increasing resource limits without checking node capacity can create another infrastructure problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Minutes 20\u201325: Troubleshoot Kubernetes Networking<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Networking problems can prevent healthy Pods from receiving requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A systematic investigation should move through the following layers:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Pod health.<\/li>\n\n\n\n<li>Service configuration.<\/li>\n\n\n\n<li>Service selectors.<\/li>\n\n\n\n<li>EndpointSlices.<\/li>\n\n\n\n<li>DNS resolution.<\/li>\n\n\n\n<li>Network policies.<\/li>\n\n\n\n<li>Ingress or load balancer configuration.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Inspect Kubernetes Services<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-25\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> services -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-25\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Describe the affected Service:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-26\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe service SERVICE_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-26\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Service type.<\/li>\n\n\n\n<li>Cluster IP.<\/li>\n\n\n\n<li>Port.<\/li>\n\n\n\n<li>TargetPort.<\/li>\n\n\n\n<li>Selector.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Check EndpointSlices<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-27\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> endpointslices -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-27\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For one particular Service:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-28\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> endpointslices \\\n  -n $NS \\\n  -l kubernetes.io\/service-name=SERVICE_NAME<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-28\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If expected endpoints are missing, investigate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pod readiness.<\/li>\n\n\n\n<li>Service selectors.<\/li>\n\n\n\n<li>Pod labels.<\/li>\n\n\n\n<li>Namespace configuration.<\/li>\n\n\n\n<li>Target ports.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A Service selector that does not match application Pod labels can prevent the Service from finding its intended backends.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Verify Pod labels<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-29\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n $NS --show-labels<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-29\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Compare the labels with the Service selector.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a Service might expect:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">selector:\n  app: backend<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">But the application Pods might use:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">labels:\n  app: backend-api<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">These selectors do not match.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Correct the configuration through your normal deployment process.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Test DNS resolution<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start a temporary diagnostic Pod if your operational policy permits it:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-30\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl run dns-test \\\n  -n $NS \\\n  --image=busybox:<span class=\"hljs-number\">1.36<\/span> \\\n  --restart=Never \\\n  -- sleep <span class=\"hljs-number\">3600<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-30\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Test DNS:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-31\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl exec dns-test -n $NS -- \\\n  nslookup SERVICE_NAME<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-31\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For a cross-namespace Service:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-32\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl exec dns-test -n $NS -- \\\n  nslookup SERVICE_NAME.OTHER_NAMESPACE.svc.cluster.local<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-32\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If DNS fails, inspect CoreDNS:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-33\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n kube-system<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-33\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-34\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> service kube-dns -n kube-system<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-34\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-35\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> endpointslices \\\n  -n kube-system \\\n  -l kubernetes.io\/service-name=kube-dns<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-35\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Investigate DNS configuration, CoreDNS health, network connectivity, and cluster-specific DNS settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remove the temporary diagnostic Pod after the investigation:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-36\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">delete<\/span> pod dns-test -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-36\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Only remove resources that you created for this investigation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Investigate Ingress<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check available Ingress resources:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-37\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> ingress -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-37\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Inspect the configuration:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-38\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl describe ingress INGRESS_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-38\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Investigate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hostname configuration.<\/li>\n\n\n\n<li>TLS settings.<\/li>\n\n\n\n<li>Backend Service name.<\/li>\n\n\n\n<li>Backend Service port.<\/li>\n\n\n\n<li>Ingress controller health.<\/li>\n\n\n\n<li>DNS records.<\/li>\n\n\n\n<li>External load balancer configuration.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A healthy application Pod does not guarantee that external users can access it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Minutes 25\u201330: Validate Recovery<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After identifying and correcting the issue, verify the complete application path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume that a successful deployment means the incident has ended.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Check deployment status<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-39\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl rollout status deployment\/DEPLOYMENT_NAME -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-39\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 2: Check Pod health<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-40\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n $NS -o wide<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-40\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Confirm that the expected replicas are available and ready.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Check Service endpoints<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-41\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> endpointslices -n $NS<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-41\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Verify that the Service has the expected ready backends.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Check application logs<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-42\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">kubectl logs deployment\/DEPLOYMENT_NAME \\\n  -n $NS \\\n  --tail=<span class=\"hljs-number\">100<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-42\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Look for repeated errors, startup failures, or dependency connection problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Test application connectivity<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the application exposes an HTTP health endpoint, test it through an approved diagnostic method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-43\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">curl -i https:<span class=\"hljs-comment\">\/\/your-application.example.com\/health<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-43\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Replace the example hostname with the real application endpoint.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Monitor the recovery<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Application response times.<\/li>\n\n\n\n<li>HTTP error rates.<\/li>\n\n\n\n<li>Pod restart counts.<\/li>\n\n\n\n<li>CPU consumption.<\/li>\n\n\n\n<li>Memory consumption.<\/li>\n\n\n\n<li>Database connectivity.<\/li>\n\n\n\n<li>Ingress errors.<\/li>\n\n\n\n<li>Customer-facing functionality.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Continue monitoring after the initial recovery window.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8. Production Troubleshooting: Five Common Scenarios<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following examples illustrate how engineers can apply the runbook.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scenario 1: Application Pods Keep Restarting<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Symptoms:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CrashLoopBackOff.<\/li>\n\n\n\n<li>Increasing restart count.<\/li>\n\n\n\n<li>Application unavailable.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Investigation:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-44\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n production\nkubectl describe pod POD_NAME -n production\nkubectl logs POD_NAME -n production --previous<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-44\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible root causes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Application startup exception.<\/li>\n\n\n\n<li>Invalid environment variables.<\/li>\n\n\n\n<li>Missing configuration.<\/li>\n\n\n\n<li>Memory exhaustion.<\/li>\n\n\n\n<li>External dependency failure.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Identify the original termination reason and correct the underlying problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not repeatedly restart the deployment without understanding why the application exits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scenario 2: Application Returns HTTP 503<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Symptoms:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ingress returns 503.<\/li>\n\n\n\n<li>Application Pods appear Running.<\/li>\n\n\n\n<li>Customers cannot access the service.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Investigation:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-45\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> svc -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> endpointslices -n production\nkubectl describe service SERVICE_NAME -n production<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-45\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible root causes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No ready endpoints.<\/li>\n\n\n\n<li>Incorrect Service selector.<\/li>\n\n\n\n<li>Readiness probe failures.<\/li>\n\n\n\n<li>Incorrect targetPort.<\/li>\n\n\n\n<li>Ingress backend configuration problems.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify the application Pods, Service selectors, EndpointSlices, and ingress controller configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scenario 3: Pods Remain Pending<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Symptoms:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Deployment creates Pods.<\/li>\n\n\n\n<li>Pods never start.<\/li>\n\n\n\n<li>Application capacity decreases.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Investigation:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-46\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> pods -n production\nkubectl describe pod POD_NAME -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> nodes\nkubectl describe node NODE_NAME<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-46\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible root causes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Insufficient CPU.<\/li>\n\n\n\n<li>Insufficient memory.<\/li>\n\n\n\n<li>Node affinity restrictions.<\/li>\n\n\n\n<li>Untolerated taints.<\/li>\n\n\n\n<li>Persistent volume problems.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Resolve the scheduling or storage constraint. Do not force Pods onto unsuitable nodes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scenario 4: Application Becomes Slow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Symptoms:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Increased request latency.<\/li>\n\n\n\n<li>Slow API responses.<\/li>\n\n\n\n<li>Intermittent timeouts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Investigation:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-47\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl top pods -n production\nkubectl top nodes\nkubectl <span class=\"hljs-keyword\">get<\/span> pods -n production\nkubectl logs deployment\/DEPLOYMENT_NAME -n production<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-47\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible root causes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU throttling.<\/li>\n\n\n\n<li>Memory pressure.<\/li>\n\n\n\n<li>Database latency.<\/li>\n\n\n\n<li>Network delays.<\/li>\n\n\n\n<li>Connection pool exhaustion.<\/li>\n\n\n\n<li>Increased traffic.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Correlate application metrics with infrastructure metrics before changing resource limits or replica counts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Scenario 5: Application Cannot Connect to Another Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Symptoms:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connection refused.<\/li>\n\n\n\n<li>DNS lookup failures.<\/li>\n\n\n\n<li>Connection timeouts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Investigation:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-48\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl <span class=\"hljs-keyword\">get<\/span> svc -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> endpointslices -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> pods -n production\nkubectl <span class=\"hljs-keyword\">get<\/span> networkpolicies -n production<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-48\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible root causes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Incorrect DNS name.<\/li>\n\n\n\n<li>Incorrect Service port.<\/li>\n\n\n\n<li>Missing endpoints.<\/li>\n\n\n\n<li>NetworkPolicy restrictions.<\/li>\n\n\n\n<li>Application binding to the wrong interface.<\/li>\n\n\n\n<li>Backend application unavailable.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Recommended response:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test connectivity from the affected workload&#8217;s network context and inspect each network layer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">9. Kubernetes Health Probes: Readiness, Liveness and Startup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Health probes play an important role in production reliability.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kubernetes supports three main probe types.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Probe<\/th><th>Purpose<\/th><th>Kubernetes Action<\/th><\/tr><tr><td>Startup<\/td><td>Checks whether an application has started<\/td><td>Delays other probes until successful<\/td><\/tr><tr><td>Readiness<\/td><td>Checks whether a container can accept traffic<\/td><td>Removes unready Pods from matching Service endpoints<\/td><\/tr><tr><td>Liveness<\/td><td>Checks whether a container should continue running<\/td><td>Restarts a container after repeated failures<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Example configuration<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-49\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">apiVersion: apps\/v1\n<span class=\"hljs-attr\">kind<\/span>: Deployment\n<span class=\"hljs-attr\">metadata<\/span>:\n  name: backend\n  <span class=\"hljs-attr\">namespace<\/span>: production\n<span class=\"hljs-attr\">spec<\/span>:\n  replicas: <span class=\"hljs-number\">3<\/span>\n  <span class=\"hljs-attr\">selector<\/span>:\n    matchLabels:\n      app: backend\n  <span class=\"hljs-attr\">template<\/span>:\n    metadata:\n      labels:\n        app: backend\n    <span class=\"hljs-attr\">spec<\/span>:\n      containers:\n        - name: backend\n          <span class=\"hljs-attr\">image<\/span>: example\/backend:<span class=\"hljs-number\">1.0<\/span>\n          <span class=\"hljs-attr\">ports<\/span>:\n            - containerPort: <span class=\"hljs-number\">8080<\/span>\n\n          <span class=\"hljs-attr\">startupProbe<\/span>:\n            httpGet:\n              path: <span class=\"hljs-regexp\">\/health\/<\/span>startup\n              <span class=\"hljs-attr\">port<\/span>: <span class=\"hljs-number\">8080<\/span>\n            <span class=\"hljs-attr\">periodSeconds<\/span>: <span class=\"hljs-number\">10<\/span>\n            <span class=\"hljs-attr\">failureThreshold<\/span>: <span class=\"hljs-number\">30<\/span>\n\n          <span class=\"hljs-attr\">readinessProbe<\/span>:\n            httpGet:\n              path: <span class=\"hljs-regexp\">\/health\/<\/span>ready\n              <span class=\"hljs-attr\">port<\/span>: <span class=\"hljs-number\">8080<\/span>\n            <span class=\"hljs-attr\">periodSeconds<\/span>: <span class=\"hljs-number\">5<\/span>\n            <span class=\"hljs-attr\">failureThreshold<\/span>: <span class=\"hljs-number\">3<\/span>\n\n          <span class=\"hljs-attr\">livenessProbe<\/span>:\n            httpGet:\n              path: <span class=\"hljs-regexp\">\/health\/<\/span>live\n              <span class=\"hljs-attr\">port<\/span>: <span class=\"hljs-number\">8080<\/span>\n            <span class=\"hljs-attr\">periodSeconds<\/span>: <span class=\"hljs-number\">10<\/span>\n            <span class=\"hljs-attr\">failureThreshold<\/span>: <span class=\"hljs-number\">3<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-49\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">This is an illustrative configuration. The application must implement the specified endpoints.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> A liveness probe should not fail simply because a temporary external dependency becomes unavailable. Poorly designed liveness checks can trigger unnecessary restarts and cascading failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Essential Kubernetes Troubleshooting Commands<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Keep this command reference available during production incidents.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Purpose<\/th><th>Command<\/th><\/tr><tr><td>Current context<\/td><td><code>kubectl config current-context<\/code><\/td><\/tr><tr><td>Cluster information<\/td><td><code>kubectl cluster-info<\/code><\/td><\/tr><tr><td>List nodes<\/td><td><code>kubectl get nodes -o wide<\/code><\/td><\/tr><tr><td>List namespaces<\/td><td><code>kubectl get ns<\/code><\/td><\/tr><tr><td>List Pods<\/td><td><code>kubectl get pods -A<\/code><\/td><\/tr><tr><td>Describe Pod<\/td><td><code>kubectl describe pod POD -n NS<\/code><\/td><\/tr><tr><td>Container logs<\/td><td><code>kubectl logs POD -n NS<\/code><\/td><\/tr><tr><td>Previous logs<\/td><td><code>kubectl logs POD -n NS --previous<\/code><\/td><\/tr><tr><td>List events<\/td><td><code>kubectl get events -A<\/code><\/td><\/tr><tr><td>CPU and memory<\/td><td><code>kubectl top pods -A<\/code><\/td><\/tr><tr><td>Node metrics<\/td><td><code>kubectl top nodes<\/code><\/td><\/tr><tr><td>List deployments<\/td><td><code>kubectl get deployments -A<\/code><\/td><\/tr><tr><td>Rollout status<\/td><td><code>kubectl rollout status deployment\/NAME -n NS<\/code><\/td><\/tr><tr><td>List Services<\/td><td><code>kubectl get svc -A<\/code><\/td><\/tr><tr><td>List EndpointSlices<\/td><td><code>kubectl get endpointslices -A<\/code><\/td><\/tr><tr><td>List Ingress<\/td><td><code>kubectl get ingress -A<\/code><\/td><\/tr><tr><td>List NetworkPolicies<\/td><td><code>kubectl get networkpolicies -A<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Replace placeholder values with actual cluster resource names.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">11. Common Kubernetes Troubleshooting Mistakes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Even experienced engineers can make production incidents worse by rushing into recovery actions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid these mistakes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Restarting Pods without collecting logs<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may lose useful information about the previous container failure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Changing resource limits without checking capacity<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A higher resource limit does not guarantee that the node has enough resources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Ignoring readiness failures<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A Running Pod can remain unavailable to Service traffic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Assuming every 503 is an application problem<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The actual cause may involve Services, EndpointSlices, Ingress, or networking.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Deleting production resources unnecessarily<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Deleting Pods, PVCs, or other resources can introduce additional risks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Ignoring recent deployment changes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An incident may be directly related to a recent image, configuration, secret, or application release.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>7. Treating a temporary recovery as a permanent fix<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restarting an application may restore service without correcting the underlying problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>8. Skipping post-recovery monitoring<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A service can become unhealthy again shortly after recovery.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">12. Production Kubernetes Troubleshooting Checklist<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use this checklist during an incident.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cluster health<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Confirm the correct cluster context.<\/li>\n\n\n\n<li>Confirm the production namespace.<\/li>\n\n\n\n<li>Check Kubernetes node status.<\/li>\n\n\n\n<li>Inspect system workloads.<\/li>\n\n\n\n<li>Review recent cluster events.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Pod health<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Identify failing Pods.<\/li>\n\n\n\n<li>Check restart counts.<\/li>\n\n\n\n<li>Inspect Pod descriptions.<\/li>\n\n\n\n<li>Review current logs.<\/li>\n\n\n\n<li>Review previous container logs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Resource investigation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check CPU consumption.<\/li>\n\n\n\n<li>Check memory consumption.<\/li>\n\n\n\n<li>Investigate OOMKilled containers.<\/li>\n\n\n\n<li>Inspect node resource pressure.<\/li>\n\n\n\n<li>Review resource requests and limits.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Networking<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify Services.<\/li>\n\n\n\n<li>Check Service selectors.<\/li>\n\n\n\n<li>Inspect EndpointSlices.<\/li>\n\n\n\n<li>Verify DNS resolution.<\/li>\n\n\n\n<li>Inspect NetworkPolicies.<\/li>\n\n\n\n<li>Check Ingress configuration.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Recovery<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Confirm deployment rollout.<\/li>\n\n\n\n<li>Verify available replicas.<\/li>\n\n\n\n<li>Confirm Service endpoints.<\/li>\n\n\n\n<li>Test application connectivity.<\/li>\n\n\n\n<li>Monitor application errors.<\/li>\n\n\n\n<li>Record the incident and root cause.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">13. How to Improve Kubernetes Production Troubleshooting<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A good runbook helps during an incident. Strong operational practices help prevent repeated incidents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Consider implementing the following improvements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Centralized logging<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use a centralized logging platform to collect container and infrastructure logs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common options include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Elasticsearch and Kibana.<\/li>\n\n\n\n<li>Grafana Loki.<\/li>\n\n\n\n<li>OpenSearch.<\/li>\n\n\n\n<li>Managed cloud logging services.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Centralized logging makes it easier to investigate failures across multiple nodes and applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Infrastructure monitoring<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use Prometheus to collect metrics from applications and Kubernetes infrastructure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Grafana can present these metrics through dashboards.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Monitor important indicators such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CPU utilization.<\/li>\n\n\n\n<li>Memory consumption.<\/li>\n\n\n\n<li>Pod restarts.<\/li>\n\n\n\n<li>Container availability.<\/li>\n\n\n\n<li>Request latency.<\/li>\n\n\n\n<li>HTTP error rates.<\/li>\n\n\n\n<li>Node conditions.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Alert management<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Configure Alertmanager or an equivalent alerting system to notify the responsible team about meaningful incidents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid alerts that generate excessive noise without requiring action.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Deployment safety<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Rolling updates.<\/li>\n\n\n\n<li>Readiness probes.<\/li>\n\n\n\n<li>Resource requests and limits.<\/li>\n\n\n\n<li>Deployment health checks.<\/li>\n\n\n\n<li>Rollback procedures.<\/li>\n\n\n\n<li>Controlled configuration changes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Incident documentation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Record:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Incident start time.<\/li>\n\n\n\n<li>Affected services.<\/li>\n\n\n\n<li>Customer impact.<\/li>\n\n\n\n<li>Initial symptoms.<\/li>\n\n\n\n<li>Investigation steps.<\/li>\n\n\n\n<li>Root cause.<\/li>\n\n\n\n<li>Recovery actions.<\/li>\n\n\n\n<li>Preventive improvements.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This information helps engineers recognize recurring problems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">14. Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is the first command to run during a Kubernetes production incident?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start by confirming the active context and cluster health.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-50\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">kubectl config current-context\nkubectl <span class=\"hljs-keyword\">get<\/span> nodes<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-50\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Then inspect the affected namespace and application Pods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I troubleshoot CrashLoopBackOff?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>kubectl describe pod<\/code> to inspect container termination details and events. Then use <code>kubectl logs --previous<\/code> to examine the previous container instance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Investigate the actual exit reason before changing the workload.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. How do I identify memory problems in Kubernetes?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>kubectl top pods<\/code> and <code>kubectl top nodes<\/code> to inspect recent resource usage. Then check Pod descriptions for OOMKilled events and compare actual usage with configured memory limits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Why is my Kubernetes Pod Running but not Ready?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The application may not be passing its readiness probe. Other causes include dependency failures, incorrect probe paths, wrong ports, or application initialization problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. How do I troubleshoot Kubernetes Service connectivity?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check Service configuration, selectors, Pod readiness, EndpointSlices, DNS resolution, and NetworkPolicies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Does kubectl top require additional components?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. The Metrics Server must be installed and functioning for <code>kubectl top<\/code> to return resource usage information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. Should I restart a Pod during a production incident?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Only when the investigation supports that action and the operational impact is understood.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Collect logs, events, and termination information first whenever possible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">8. How long does Kubernetes troubleshooting take?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simple configuration or application failures may be identified quickly. Infrastructure, storage, networking, and distributed application problems can require much longer investigation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A 30-minute runbook provides an organized initial triage process rather than a guaranteed resolution time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Production Kubernetes troubleshooting requires a structured approach.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start with cluster health. Investigate failing Pods, container logs, events, and resource consumption. Then check Services, EndpointSlices, DNS, and application connectivity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, validate the recovery and monitor the application for recurring failures.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A practical 30-minute runbook gives DevOps and SRE teams a consistent starting point during production incidents. More importantly, it encourages engineers to investigate root causes instead of relying on repeated restarts and risky production changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The best troubleshooting process restores service safely, preserves useful evidence, and reduces the likelihood of similar incidents in the future.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A production Kubernetes incident can affect customers within seconds. A failing Pod, exhausted node, broken Service, or incorrect deployment can&#8230; <\/p>\n","protected":false},"author":7,"featured_media":3446,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"series":[],"class_list":["post-3443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/3443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/comments?post=3443"}],"version-history":[{"count":2,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/3443\/revisions"}],"predecessor-version":[{"id":3447,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/posts\/3443\/revisions\/3447"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/media\/3446"}],"wp:attachment":[{"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/media?parent=3443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/categories?post=3443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/tags?post=3443"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.rajeshkumar.xyz\/blog\/wp-json\/wp\/v2\/series?post=3443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}