How do I reduce downtime of nginx ingress route when updating a destination pod? How do I reduce downtime of nginx ingress route when updating a destination pod? kubernetes kubernetes

How do I reduce downtime of nginx ingress route when updating a destination pod?


You can use the nginx.ingress.kubernetes.io/service-upstream annotation to suppress the normal Endpoints behavior and use the Service directly instead. This has better integration with some deployment models but 5-7 seconds is extreme for ingress-nginx to be seeing the Endpoints update. There can be a short gap from when a pod is removed and when ingress-nginx sees the Endpoint removal. You usually fix that with a pre-stop hook that just sleeps for a few seconds to ensure by the time it actually exits, the Endpoint change has been processed everywhere.