Skip to content

Commit 21bf5f9

Browse files
authored
Update cheatsheet.md
Adding comments to ensure default namespace, container and that the command is supported. Add note to show you can substitute `env` for any supported command.
1 parent 98a20fb commit 21bf5f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/reference/kubectl/cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ kubectl get nodes -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
217217
# Produce a period-delimited tree of all keys returned for pods, etc
218218
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
219219

220-
# Produce ENV for all pods
221-
# Make sure to set your default namespace or this will run on system pods
220+
# Produce ENV for all pods, assuming you have a default container for the pods, default namespace and the `env` command is supported.
221+
# Helpful when running any supported command across all pods, not just `env`
222222
for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo $pod && kubectl exec -it $pod env; done
223223
```
224224

0 commit comments

Comments
 (0)