Assist those who struggle to find path to relevant keys in Json output.

This commit is contained in:
Garron Kramer 2020-08-05 06:52:38 +03:00
parent 8ea2145220
commit 05a417c303
No known key found for this signature in database
GPG Key ID: 83C8997E71B2B0B0
1 changed files with 7 additions and 0 deletions

View File

@ -204,6 +204,13 @@ kubectl get events --sort-by=.metadata.creationTimestamp
# Compares the current state of the cluster against the state that the cluster would be in if the manifest was applied.
kubectl diff -f ./my-manifest.yaml
# Produce a period-delimited tree of all keys returned for nodes
# Helpful when locating a key within a complex nested JSON structure
kubectl get nodes -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
# Produce a period-delimited tree of all keys returned for pods, etc
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
```
## Updating Resources