Skip to content

Instantly share code, notes, and snippets.

@leafnode
Created December 20, 2019 15:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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