# Pod number environment variable

**URL:** <https://forums.suse.com/t/pod-number-environment-variable/40428>\
**Category:** SUSE Rancher Prime\
**Created:** [April 7, 2023, 6:07am UTC](https://forums.suse.com/t/pod-number-environment-variable/40428 "2023-04-07T06:07:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadeemramsing](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nadeemramsing/32/10041_2.png) [@nadeemramsing](https://forums.suse.com/u/nadeemramsing)\
**Post date:** [April 7, 2023, 6:07am UTC](https://forums.suse.com/t/pod-number-environment-variable/40428/1 "2023-04-07T06:07:43Z")

</div>

Hello.

Context: I’ve got a nodejs app running as a service on Rancher2 and soon I will be adding a cron job with a db update on the nodejs app itself. The cron job will start on app start.

Question: Is there a way that I can run the cron job only in one pod? For example, does Rancher provide something like a pod number environment variable, where I can run the cron job only in for e.g. pod 1 (while other pods e.g. 2, 3, 4 being ignored)?

I know same can be achieved by exposing the script as an endpoint and using a cron type of service on Rancher, but I wanted to avoid this additional cron service.

Thank you.
