# Know whether pod deletion is triggered by scaling down

**URL:** <https://discuss.kubernetes.io/t/know-whether-pod-deletion-is-triggered-by-scaling-down/7031>\
**Category:** General Discussions\
**Created:** [July 3, 2019, 5:31pm UTC](https://discuss.kubernetes.io/t/know-whether-pod-deletion-is-triggered-by-scaling-down/7031 "2019-07-03T17:31:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lethalgerbil](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/lethalgerbil/32/3267_2.png) [@lethalgerbil](https://discuss.kubernetes.io/u/lethalgerbil)\
**Post date:** [July 3, 2019, 5:31pm UTC](https://discuss.kubernetes.io/t/know-whether-pod-deletion-is-triggered-by-scaling-down/7031/1 "2019-07-03T17:31:32Z")

</div>

Kubernetes version: 1.12.8 Cloud being used: AWS Installation method: KOps Host OS: Ubuntu16 CNI and version: CRI and version: I would like to be able to know whether a container is being deleted due to scaling down or something else in the lifecycle preStop command. Is it possible to get the desired replica count inside of a pod? In my case, I am running a statefulset of cassandra nodes. When I scale down the set, I want to decomission the node and move the nodes data off that nodes volume, but if the node is deleted for another reason, I want to leave the data on the volume. Is there a solution to this problem? Thanks
