Last active
November 29, 2019 01:01
-
-
Save madsonic/1760d81a35606434c464884c69f7a928 to your computer and use it in GitHub Desktop.
kubectl output format
This file contains hidden or 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
| # 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