We are deploying the application in a Kubernetes cluster and when we face an unexpected error and the pod gets restarted or goes down we are getting a 502 Gateway error even though there is another pod that should start accepting the requests without getting the 502 gateway error.

We are making sure that the application is cluster enabled and the request is redirected to the another pod automatically when we stop/kill the pod gracefully but doesnot happen on a exception.

1 Answer 1


You should configure a Readiness Probe in the Deployment for your app. When using a Readiness Probe, no traffic will be sent to instances that are not prepared to receive traffic.

  • Readiness probe is configured and kicks in when we stop the pod gracefully and does not work as mentioned when the pod is killed because of an out of memory exception. Jan 13, 2021 at 14:15
  • @SriKrishna the pod is killed when you run out of memory, e.g. by setting resource limits. The Readiness Probe is run regularly, and you can adjust how often it is run, e.g. with periodSeconds: 5 but you can lower that period if you want.
    – Jonas
    Jan 13, 2021 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.