Skip to content

Commit 98a20fb

Browse files
authored
Update cheatsheet.md
Adding a common command I use to ensure common or namespace wide ENV variables are properly set, i.e. by a ConfigMap
1 parent 17e45d8 commit 98a20fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ kubectl get nodes -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
216216

217217
# Produce a period-delimited tree of all keys returned for pods, etc
218218
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
219+
220+
# Produce ENV for all pods
221+
# Make sure to set your default namespace or this will run on system pods
222+
for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo $pod && kubectl exec -it $pod env; done
219223
```
220224

221225
## Updating resources

0 commit comments

Comments
 (0)