My aim is to gracefully terminate my REST application Pods. I have 2 pods running and when 1 Pod is deleted, requests should be gracefully migrated to other pods. I am using Minikube (v1.20.0)for testing with Jmeter script running 100 API calls. I have also added a delay of 3 seconds inside my API.
I tried to set value of terminationgraceperiodseconds to 60 but learnt that pod was getting deleted within 30 seconds and there were some failures in my jemeter test requests.
I tried reducing value of terminationgraceperiodseconds to 10 seconds and saw that Pod gets deleted within 10 seconds.
Next I read about preStop hook and I added a preStop hook with sleep time as 15 seconds. With this change, my requests started gracefully migrating to other pods even if i deleted the pod which was swerving requests.
I would like to know why parameter terminationgraceperiodseconds whose value set to 60 seconds is taking 30 seconds to terminate the pod. Any other settings I need to change ?