I want to reduce the number of my pods with full control over the pod that should be shut down. Right now I reduce the number of pods and Kubernetes sends a SIGTERM and after 30 Secounds the pod will be deleted.
I want to know when I listen to the SIGTERM in my pod and exit like this:
if SIGTERM send
exit(0)
What will Kubernetes do:
- Restart the pod and kill it after 30 secounds because of the sigterm
- Ignore the sigterm, because the pod was shut down by itself
- Throw an error, because it tries to delete a pod that is already deleted