Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created April 16, 2017 02:04
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 jmhodges/3112590a33ef20aa434e5e3950df7c15 to your computer and use it in GitHub Desktop.
Save jmhodges/3112590a33ef20aa434e5e3950df7c15 to your computer and use it in GitHub Desktop.
Grab pod name, container name, and container image from kubernetes with kubectl
#!/bin/bash
kubectl get po --template '{{ range $i, $p := .items }}{{ range $j, $c := $p.spec.containers }}{{ printf "%s %s %s\n" $p.metadata.name $c.name $c.image }}{{ end }}{{ end }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment