Feature: Labels for specific indices to use as a selector?

590 views
Skip to first unread message

v

unread,
Jun 2, 2023, 8:05:44 PM6/2/23
to wg-b...@kubernetes.io
Hi Batch WG!

I've recently been exposing services, everything from a little API running inside one of the indices of my job, to an actual Kubernetes cluster API, and in both these cases I've had to manually label the index 0 pod of my indexed job. The docs say that we should see batch.kubernetes.io/X labels, but I see "app.kubernetes.io/name=flux-sample." I noticed that we do have an annotation that corresponds to the index with this format:

Annotations:      batch.kubernetes.io/job-completion-index: 0

But for labels I only see my custom labels, along with the app one mentioned above that has the job name:

Labels:      app.kubernetes.io/name=flux-sample
                  namespace=flux-operator

I think I'd like to see an equivalent label for the job completion index for use as a selector, unless there is some way to take advantage of the annotation that I'm not aware of.

Has anyone else wanted or needed this use case?

Happy Friday!

Best,

Vanessa

Daniel Vega-Myhre

unread,
Jun 3, 2023, 12:52:23 PM6/3/23
to v, wg-b...@kubernetes.io
Hi Vanessa,

There is a KEP under review right now which proposes adding the job completion index as a label on indexed job pods (as well as adding the pod index as a label for StatefulSet pods): https://github.com/kubernetes/enhancements/pull/4019

Feel free to add any thoughts/feedback you have on it.


--
To unsubscribe from this group and stop receiving emails from it, send an email to wg-batch+u...@kubernetes.io.

Aldo Culquicondor

unread,
Jun 4, 2023, 9:34:09 AM6/4/23
to Daniel Vega-Myhre, v, wg-b...@kubernetes.io
In other words, today there's no other alternative than adding the index manually.

Aldo

v

unread,
Jun 4, 2023, 12:16:53 PM6/4/23
to Aldo Culquicondor, Daniel Vega-Myhre, wg-b...@kubernetes.io
Cool - then that is what I will keep doing (and I also added a comment to the KEP). Thank you to you both!
Reply all
Reply to author
Forward
0 new messages