How to Debug a 502 on Kubernetes

Cameron Manavian
5 min readMar 10, 2020

Here is a thorough method to check the readiness of your application in order to determine the cause of your 502 problem

You did it — you’ve built a Docker image, created a Cluster, set up a Deployment, structured a Service, and configured an Ingress alongside an automated TLS certificate issuer!

Your app is ready to go!

Photo by Nikhil Mitra on Unsplash

As you load the domain in your browser and prepare to see your completed work, you are instead greeted with an ugly and awful error page reading:

502 Server Error

Error: Server Error

The server encountered a temporary error and could not complete your request. Please try again in 30 seconds.

Here is a picture:

A 502 error from Kubernetes ingress failures

Aside from deep-level debugging on the app layer, its often beneficial to first determine the overall healthiness of your application’s setup, starting from the pod, then container, then service, then ingress, and finishing with application-level debug logs. At the end of the article is a list of common debugging steps to try out if you don’t want to run through a full end-to-end

--

--