i would like to list all pods of a specific namespace but only those that are controlled by deployment
i have tried this but didn't succeed:
kubectl get pods --all-namespaces -o json | jq -r '.items | map(select(.metadata.ownerReferences == deployment ) | .metadata.name) | .[]'
I use this command:
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.spec.containers[*].name}{"\n"}{end}' --all-namespaces |sed 's/\t/\'$'\\/g' | sort | uniq
to list all containers and their namespaces so i want the same but filtering out all non-deployments kind