Last active
March 25, 2020 14:14
-
-
Save madsonic/5192ea63f43fa212308d7e68afeeb338 to your computer and use it in GitHub Desktop.
kubectl-jq
This file contains 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
# conditional expr | |
# select(.metadata.name == "abc") single test | |
# select(.metadata.name|test("abc.")) regex test | |
# final pipe expr prints in defined json shape | |
k get deploy --all-namespaces -o json | \ | |
jq '.items[] | select(.metadata.name|test("abc.") | not) | {"name":.metadata.name,"podSpec":.spec.template.spec}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment