advancedSpring Boot on Kubernetes: Health Probes, Config, Scaling & Observability
Rolling deployment causes 502 errors even with graceful shutdown configured
Check the relationship between terminationGracePeriodSeconds, the graceful shutdown timeout, and how quickly the load balancer removes the Pod from its backend pool. If the LB continues routing to a Pod that has already stopped accepting requests, 502s result. Also check readiness probe removal speed -- the EndpointSlice controller removes the Pod from Service endpoints after readiness fails, but there may be a propagation delay.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response