Ingress and Load Balancer Errors — 502, 503, 504, 404, 413 and TLS

The errors users see at the edge of a Kubernetes cluster: what each status code proves about where the request stopped, the first command for each, and how it looks on EKS, AKS, GKE and Gateway API.

Overview

Ingress and load balancer errors are the ones your users see. They happen on the way in, often before the request reaches your code, so the pods can look perfectly healthy while every request fails. The job at this layer is to find where the request stopped: at the cloud load balancer, at the Ingress controller (or Gateway), at the Service and its EndpointSlices, or at the pod itself.

The one idea to keep: the status code tells you how far the request got. With an NGINX-based controller, a 404 means no rule matched, a 503 means a rule matched but there was no ready backend, a 502 means the proxy reached a backend and the conversation broke, and a 504 means a backend accepted the request and did not answer in time. A TLS error means the connection failed before HTTP started at all. Read the code first and you already know which object to open. Be careful with one detail: that mapping belongs to the proxy, not to HTTP. Envoy-based gateways return 503 for a failed upstream connection, and Azure Application Gateway returns 502 for an empty backend pool, so always ask which proxy produced the page.

Work from the outside in: start with the proxy's own log line for the failing request, then the Service's EndpointSlices, then the pod. Starting at the pod wastes time, because a healthy pod says nothing about whether the proxy could reach it. Two facts from 2025-2026 shape this page: the community ingress-nginx controller was retired in March 2026 (no more releases or security fixes; existing installs keep running), and the Kubernetes project now recommends Gateway API over the frozen Ingress API. Every section therefore also says how the same failure shows up on an HTTPRoute.

The request path, hop by hop

A request to your API crosses the same hops every time, and each status code on this page is produced at one of them. The figure shows the path; the steps under it say which code each hop returns.

Key concepts

  • Status code as location
  • EndpointSlice
  • Default backend
  • IngressClass
  • Shortest timer wins
  • preStop hook
  • Keep-alive race
  • HTTPRoute conditions
  • ingress-nginx retirement

Interview questions

  • After a deploy, users see intermittent 502s for about 20 seconds, then everything is fine. Walk me through it.
  • An Ingress returns 503 for one service while the pods show Running. How do you find the cause in under five minutes?
  • A report endpoint returns 504 after exactly 30 seconds on GKE, even though you set proxy-read-timeout to 180 on the Ingress. Why?
  • A new NetworkPolicy went out and now some requests through the Ingress hang and fail with 504, while pods in the same namespace can call the service fine. What happened?
  • How does diagnosing a 502 differ between ingress-nginx on EKS, AGIC on AKS and GKE Ingress?
  • A browser shows the Kubernetes Ingress Controller Fake Certificate for your production host. What do you check, in order?
  • Your company still runs ingress-nginx. What is your plan, and what changes in how you debug?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio