Skip to content

Instantly share code, notes, and snippets.

Created Dec 20, 2019
What would you like to do?
Get pods with node name with filtering #docker #kubernetes
kubectl get pods -l 'app==coredump-agent' --template='{{range .items}}{{.spec.nodeName}} {{}}{{"\n"}}{{end}}'
kubectl get pods --template '{{range .items}}{{if eq .spec.nodeName "ip-254-0-90-30.ec2.internal"}}{{}}{{"\n"}}{{end}}}{{end}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment