I've a task list to Kubernetes pods by its kind. For Eg List kubernetes pods that are in different namespace using Jsonpath. I'm using the below command which is not working.
kubectl get pods -o jsonpath='{.items[?(@.items.kind=="Elasticsearch")]}'
To see the pods in different namespace:
kubectl get pods -o jsonpath='{.items[?(@.kind=="Pod")]}' -n <namespace-name>
You can try to use the following command.
kubectl get pods -o jsonpath='{.items[?(@.kind=="Pod")]}' --all-namespaces