1

I want to get all pods with a specific label in all contexts.

What I have to do now is to iterate the contexts found in kubectl config get-contexts:

kgp --context [CONTEXT] -n my-namespace -l app=my-app

Is there an equivalent of all-namespaces but for contexts?

Juancki
  • 1,793
  • 1
  • 14
  • 21
  • 1
    Nowhere mentioned in [offical doc](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-and-finding-resources) that we can get the pods from all contexts. The best way is as you mentioned you need to loop through the context and get the pods and save into a file for the full list. – Dharani Dhar Golladasari Jan 18 '23 at 08:13

0 Answers0