Skip to content

Instantly share code, notes, and snippets.

@guessi
Created April 4, 2018 13:51
Show Gist options
  • Save guessi/94c8d116bab87cb8224c2a417930e5cc to your computer and use it in GitHub Desktop.
Save guessi/94c8d116bab87cb8224c2a417930e5cc to your computer and use it in GitHub Desktop.
Find Out Pod Name by Query Pod IP Address (Kubernetes)
#!/bin/bash
for pod in $(etcdctl ls /registry/pods/default); do
printf "%-16s ==> %s\n" "$(etcdctl get ${pod} | jq -r '.status.podIP')" "$(basename ${pod})"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment