I have to changed the terminationGracePeriodSeconds
from 30 to 120 in Kubernetes deployment manifest file but when I am deploying using helm:
helm upgrade --install <chartname> --values <valuesfilename>
The old pods getting terminated immediately and new pods started running.
But the expected behavior is to keep the old pods in terminating state and continue its current processes for 120 seconds as defined.
What else could be missing here?
Does this solve my issue here?
containers:
- name: containername
lifecycle:
preStop:
exec:
command: [ "/bin/sleep", "20" ]
One question I had is does adding sleep command stops execution of current processes of the pod and just sleeps while it is in terminating state?