Skip to content

Instantly share code, notes, and snippets.

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