I have a simple docker container, that get jobs from a queue. A scaling script handles the amount of pods that run right now by sending an api request to the replication controller.
The problem is that I don't want to shut down a pod when he is doing a job right now. If I reduce the amount of pods kubernetes will delete the last created pod.
So I want to know if it's possible to tell the last pod, that he will be shut down in some minutes so he should not get a new job? One solution would be that the scaling script is is calling the last pod manually. But is it possible for every pod to listen to for the shut down event for his own instance?