I am trying to add preStop hook to my k8s container but for some reason sleep seems like it does not work. I tried to add echo and in that case I can see that it work. But when I replace echo with sleep it seems like it does not work and sleep because pod is removed before given number of seconds in the sleep command.
lifecycle:
preStop:
exec:
command:
- sleep 60
Note than my gracefulTerminationPeriod is above 60.
Also I wonder if my app can send http request to outside of the pod during this period.
What is wrong here actually ?