07 เมษายน 2566

Connection outbound of Kubernetes Pod is terminated after SIGTERM SIGINT Graceful Shutdown


 If you are facing a problem like

  • Adding terminationGracePeriodSecond to your Kubernetes Deployment to handle graceful shutdown, but your Kubernetes Pod cannot connect Database, Redis, Queue to do some clean up
  • Your Kubernetes Pod is terminated immediately (before terminationGracePeriodSecond period)

The root cause maybe Istio sidecar is terminated before the Kubernetes Pod 


Solution

For example, you have terminationGracePeriodSeconds: 315

You need to add terminationDrainDuration to your Kubernetes Deployment also, e.g.,

annotations:
proxy.istio.io/config: |
terminationDrainDuration: 315s


Reference

  • How can I prevent Istio sidecar from shutting down before my service has finished gracefully terminating? Link

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

บทความยอดนิยม (ล่าสุด)

บทความยอดนิยม (All Time)