ory / graceful

A best practice http server set up that supports graceful shutdown
Apache License 2.0
191 stars 18 forks source link

Kubernetes: handle sigterm to support graceful shutdown #3

Closed genesis32 closed 5 years ago

genesis32 commented 6 years ago

Hi, this is a minor nit (let me know if you want me to submit a PR to fix it). Basically when containers are shutting down in Kubernetes they are sent a SIGTERM on PID 1. The docker images you have for hydra are awesome but hydra only gracefully shuts down on a SIGINT. Supporting both SIGINT and SIGTERM seems sane. I think we can work around this by checking for a file in the container and deleting it on preStop.

https://github.com/ory/graceful/blob/3193de1e065e469711b7a42abd6092b5b92570e2/http_graceful.go#L58

aeneasr commented 6 years ago

Yes, feel free to create a PR! :)