Q: A stateless web application runs on Kubernetes. During a deployment of a new image, users report intermittent HTTP 502 Bad Gateway errors for a few seconds. What is missing in the Pod configuration?
Two crucial things are likely missing or misconfigured:
#General DevOps #General DevOps — Scenario-Based Interview Questions #L2 #DevOps #SRE #Architecture
🎙️ Candidate Opening & Architectural Context
""Senior DevOps is about building reliable automated feedback loops between code commit and production observability. The interviewer is testing: Readiness probes, graceful shutdown, zero-downtime deployments.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
Two crucial things are likely missing or misconfigured:
- Readiness Probes: The new container starts, and Kubernetes instantly sends traffic to it before the internal application framework (like Spring Boot or Node.js) has fully initialized its HTTP listeners. A
readinessProbeensures the Service doesn't route traffic to the Pod until a specific path (e.g.,/health) returns HTTP 200. - Graceful Shutdown (SIGTERM handling): When the old Pod is deleted, Kubernetes sends a SIGTERM. If the application exits instantly, any requests currently in flight are abruptly dropped (HTTP 502). The application must catch the SIGTERM, stop accepting new connections, finish processing in-flight requests, and gracefully exit.
2️⃣
Remediation & Permanent Safeguards
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Readiness Probes: The new container starts, and Kubernetes instantly sends traffic to it before the internal application framework."
⚡ 60-Second Elevator Pitch Talking Points
- Readiness Probes: The new container starts, and Kubernetes instantly sends traffic to it before t...
- Graceful Shutdown (SIGTERM handling): When the old Pod is deleted, Kubernetes sends a SIGTERM. If...
Advertisement