Query regarding the preStop hook

Hi Team,

This query is regarding the gracefull shutdown of pod. We have an application running in the k8s cluster which requires 5-10min for state saving during an upgrade scenario.

I came across a k8s native way of gracefull shutdown using preStop lifecycle hook but was having. a doubt if it is okay to add the sleep of 5-10 min in the preStop hook for application to save the state before receiving the SIGTERM signal. Is it safe to do as it seems preStop hook is being called synchronously?

Amit Katyal

Cluster information:

Kubernetes version: 1.21
Cloud being used: AWS EKS
Installation method: terraform
Host OS: Linux
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.