Skip to content

Instantly share code, notes, and snippets.

@madsonic
Last active November 29, 2019 01:01
Show Gist options
  • Select an option

  • Save madsonic/1760d81a35606434c464884c69f7a928 to your computer and use it in GitHub Desktop.

Select an option

Save madsonic/1760d81a35606434c464884c69f7a928 to your computer and use it in GitHub Desktop.
kubectl output format
# customise output format with go template
kubectl ... -o go-template --template="{{range .items}}{{range .spec.containers}}{{.image}} {{end}}{{end}}"
kubectl get deploy -o go-template --template='{{range .items}}{{printf "%s\n" .metadata.name}}{{end}}'
# for keys with dots or special characters
kubectl get secrets regcred -o "jsonpath={ .data['\.somesecret'] }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment