Created
December 20, 2019 15:01
-
-
Save leafnode/23ee901dea3d92be2d719ceef703e0fb to your computer and use it in GitHub Desktop.
Get pods with node name with filtering #docker #kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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