{"repo":"godaddy/terminus","free":true,"listed":false,"github":"https://github.com/godaddy/terminus","clone":"git clone https://github.com/godaddy/terminus.git","description":"Graceful shutdown and Kubernetes readiness / liveness checks for any Node.js HTTP applications","language":"JavaScript","stars":1911,"topics":["nodejs","kubernetes","graceful-shutdown","hacktoberfest"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"terminus Adds graceful shutdown and Kubernetes readiness / liveness checks for any HTTP applications. Installation Install via npm: Usage With custom error messages With custom headers With express With koa With cluster (and eg. express) If you want to use ( cluster )[https://nodejs.org/api/cluster.html] to use more than one CPU, you need to use terminus per worker. This is heavily inspired by https://medium.com/@gaurav.lahoti/graceful-shutdown-of-node-js-workers-dd58bbff9e30. See example/express.cluster.js . How to set Terminus up with Kubernetes? When Kubernetes or a user deletes a Pod, Kubernetes will notify it and wait for gracePeriod seconds before killing it. During that time window (30 seconds by default), the Pod is in the terminating state and will be removed from any Services by a controller. The Pod itself needs to catch the SIGTERM signal and start failing any readiness probes. If the ingress controller you use route via the Service, it is not an issue for your case. At the time of this writing, we use the nginx ingress controller which routes traffic directly to the Pods. During this time, it is possible that load-balancers (like the nginx ingress controller) don't remove the Pods \"in time\", and when the Pod dies, it kills live connections. To make sure you don't lose any connections, we recommend delaying the shutdown with the number of milliseconds that's defined by the readiness probe in your deployment configuration. To help with this, terminus exposes an opt","default_branch":null,"files":null,"tree":[],"storefront":"/r/godaddy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/godaddy/terminus/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}