Maybe I don't understand - the labels in the template are applied to the pod. Just label select against pods.
On Sun, May 20, 2018, 8:12 AM Torsten Bronger <bron...@physik.rwth-aachen.de> wrote: > Hallöchen! > > Since this question is apparently off-topic on SO > (https://stackoverflow.com/q/50434349/188108), I ask here: What is > the recommended way to get the pods of a Kubernetes deployment? > > Currently, I do: > > 1. Add unique labels to the deployment's template. > > 2. Get the revision number of the deployment. > > 3. Get all replica sets with the labels. > > 4. Filter them further to find the one with the correct revision > number. > > 5. Extract the pod template hash from the replica set. > > 6. Get all pods with the labels plus the pod template hash. > > However, this is awkward and complex. Besides, I am not sure that > (4) and (6) are guaranteed to yield only the wanted objects. Is > there a more reliable and possibly simpler way? > > Tschö, > Torsten. > > -- > Torsten Bronger > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com. > To post to this group, send email to kubernetes-users@googlegroups.com. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.