| K8s will send a SIGTERM to your process notifying it to shut down. After 30 seconds a SIGKILL is sent if the process didn't cooperate. In node, we can listen for SIGTERM as follows:
process.on('SIGTERM', function () { |
// kill db connection etc etc |
server.close(function () { |
process.exit(0); |
}); |
});
|
|