Team,
I am able to fetch all pods running on a node with its namespace but my namespaces are generated dynamically and they change with characters in end. is there a way i can include a regex/pattern that I can use in kubectl command to pull all pods from all matching namespace?
kubectl get pods -n team-1-user1 --field-selector=spec.nodeName=node1,status.phase=Running
actual output1: works
NAMESPACE NAME READY STATUS RESTARTS AGE
team-1-user1 calico-node-9j5k2 1/1 Running 2 104d
team-1-user1 kube-proxy-ht7ch 1/1 Running 2 130d
I want below pulling pods for all namespaces starting with "team-".
kubectl get pods -n team-* --field-selector=spec.nodeName=node1,status.phase=Running
actual output2: fails
No resources found in team-workflow-2134-asf-324-d.yaml namespace.
expected outout: want this..
NAMESPACE NAME READY STATUS RESTARTS AGE
team-1-user1 calico-node-9j5k2 1/1 Running 2 104d
team-1-user1 kube-proxy-ht7ch 1/1 Running 2 130d
team-2-user1 calico-node-9j5k2 1/1 Running 2 1d
team-2-user1 kube-proxy-ht7ch 1/1 Running 2 10d