Description
One of the ideas to implement Graceful Shutdown is to use Kubernetes Pre-Stop Hook. When user kills the entire cluster (oc scale dc/<name> --replicas=0), Kubernetes sends invokes Pre-Stop script in all containers and sends SIGTERM signal. After graceful period (30s by default) it just kills the containers.