Skip to content

Instantly share code, notes, and snippets.

@ethernetdan
Created December 5, 2015 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethernetdan/fd5e335ead8706284a6d to your computer and use it in GitHub Desktop.
Save ethernetdan/fd5e335ead8706284a6d to your computer and use it in GitHub Desktop.
function getRCPods() {
ARGS=$2
selector=$(kubectl get rc/$1 --template='{{range $k, $v := .spec.selector}}{{printf "%s=%s" $k $v}}{{end}}' $ARGS)
kubectl get pods --selector="$selector" --template='{{range .items}}{{printf "%s\n" .metadata.name}}{{end}}' $ARGS
}
alias pods=getRCPods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment