0

We are implementing the microservice architecture. Now we faced the issue, that when we terminate the server by k8s for spring web it responds nothing for gRPC it responds 504. We would like to customize this behavior to return 503 for both cases.

I read some topics about the graceful shutdown in spring but haven't found any useful information on how to customize this.

Leo
  • 695
  • 3
  • 11
energy2522
  • 149
  • 2
  • 10
  • Do you actually need that? When the pod transitions into the `Terminating` state, it will no longer receive traffic. See also: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination – Emile Pels May 23 '22 at 15:20
  • @EmilePels I know that it will not receive traffic. We want to build our custom retry logic and in case if service returns 503 we will repeat the request to another pod. The issue is, that if a service isn't able to respond before shutdown it returns nothing. – energy2522 May 23 '22 at 19:03

0 Answers0