# Pod counts in jobs/deployments

**URL:** <https://discuss.kubernetes.io/t/pod-counts-in-jobs-deployments/10446>\
**Category:** General Discussions\
**Created:** [April 9, 2020, 12:15am UTC](https://discuss.kubernetes.io/t/pod-counts-in-jobs-deployments/10446 "2020-04-09T00:15:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magicaltrout](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/magicaltrout/32/4917_2.png) [@magicaltrout](https://discuss.kubernetes.io/u/magicaltrout)\
**Post date:** [April 9, 2020, 12:15am UTC](https://discuss.kubernetes.io/t/pod-counts-in-jobs-deployments/10446/1 "2020-04-09T00:15:04Z")

</div>

Hi folks,

This conundrum has been doing my head in for days, it seems simple but isn’t and I’m trying not to have to deploy a whole workflow platform to deal with it.

All I want to do is run a set of containers which run a batch task, but the pods need to download a chunk of data unique to their environment. Statefulsets are perfect because the incremental hostname makes it easy to figure out which number of the batch it is, except for some reason it was deemed unacceptable to have statefulset pods complete, so instead it ends up in a cycle of doom…

Jobs, eh? How did that spec come to be without the ability to track hostname, or a variable of the “I’m pod 3 of 5” ilk?

Anyone got any bright ideas?

---

<div class="post-metadata">

**Author:** ![justoon](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@justoon](https://discuss.kubernetes.io/u/justoon)\
**Post date:** [April 15, 2020, 1:19am UTC](https://discuss.kubernetes.io/t/pod-counts-in-jobs-deployments/10446/2 "2020-04-15T01:19:58Z")

</div>

Without understanding your use-case completely, two options come to mind.

1. Utilize a long-running pod that acts as a job controller that allocates the data to each job worker
2. Leverage Metacontroller’s IndexedJob example  
[https://github.com/GoogleCloudPlatform/metacontroller/tree/master/examples/indexedjob](https://github.com/GoogleCloudPlatform/metacontroller/tree/master/examples/indexedjob)
