During Postgres Operator upgrade (for example, from 3.0.0 to 4.2.4), some pods may remain stuck in a "Terminating" state while being replaced as part of the upgrade process.
This behavior is typically observed during rolling updates where old pods are terminated and new pods are created.
Symptoms
This issue is not related to PostgreSQL itself.
After PostgreSQL shuts down successfully, Kubernetes must complete additional cleanup operations before removing the pod object, including:
If any of these steps are delayed, particularly volume detach operations managed by the CSI driver, the pod may remain stuck in the Terminating state even though the database process has already exited.
This behavior is more likely during upgrades due to:
Workaround:
If PostgreSQL has already shut down cleanly and the pod remains stuck in Terminating state, it is generally safe to force delete the pod:
kubectl delete pod <pod-name> --grace-period=0 --force