Skip to content

Instantly share code, notes, and snippets.

@afirth
Last active March 28, 2020 05:13
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 afirth/e859b649bb7b657f25eec3a9358f5627 to your computer and use it in GitHub Desktop.
Save afirth/e859b649bb7b657f25eec3a9358f5627 to your computer and use it in GitHub Desktop.
jq for kubectl
#name and status
k get zb -o json | jq -r '.items[] | [.metadata.name, .status.ready] | @tsv'
#get pods by label, show image and ready status
kgp --all-namespaces -l app.kubernetes.io/component=gateway -o json | jq -r '.items[] |[ .metadata.namespace, .status.containerStatuses[0].ready, .status.containerStatuses[0].image ] | @tsv' | grep alpha <<<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment