Merge pull request #27557 from robertsonai/patch-1
Add common command to list ENV for all pods
This commit is contained in:
commit
6a2b65d85d
|
|
@ -216,6 +216,10 @@ kubectl get nodes -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
|
||||||
|
|
||||||
# Produce a period-delimited tree of all keys returned for pods, etc
|
# Produce a period-delimited tree of all keys returned for pods, etc
|
||||||
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
|
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
|
||||||
|
|
||||||
|
# Produce ENV for all pods, assuming you have a default container for the pods, default namespace and the `env` command is supported.
|
||||||
|
# Helpful when running any supported command across all pods, not just `env`
|
||||||
|
for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo $pod && kubectl exec -it $pod env; done
|
||||||
```
|
```
|
||||||
|
|
||||||
## Updating resources
|
## Updating resources
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue