Not sure why I'm not doing more with jsonpath but I do admire the elegance and simplicity of this: -
kubectl get service cluster-proxy -n default -o=jsonpath='{.spec.clusterIP}'
as compared to my default muscle memory using jq : -
kubectl get service cluster-proxy -n default --output JSON | jq -r .spec.clusterIP
The jsonpath alternate definitely requires fewer keystrokes AND doesn't require me to install jq
Although, to be honest, I'm not going to stop using jq for all my other JSON wrangling ....
No comments:
Post a Comment