Terminating a process with Ctrl-C or SIGTERM in Kubernetes leaves the process stuck. This change fixes the issue, by calling the stop() method on the services and then exiting the process.
This fixes both the behavior of having a stuck container, when pressing Ctrl-C, as well as pods which remain in the termination state until Kubernetes uses more force to kill the pods.
Terminating a process with Ctrl-C or SIGTERM in Kubernetes leaves the process stuck. This change fixes the issue, by calling the
stop()
method on the services and then exiting the process.This fixes both the behavior of having a stuck container, when pressing Ctrl-C, as well as pods which remain in the termination state until Kubernetes uses more force to kill the pods.