Files
oam/knowledge base/get the environment of processes running in containers.md
2023-11-18 19:48:55 +01:00

922 B

Get the environment of processes running in containers

Table of contents

  1. TL;DR
  2. Further readings
  3. Sources

TL;DR

# From a shell inside the container.
cat "/proc/${PID}/environ"

# In Kubernetes.
kubectl exec 'pod-name' -- cat '/proc/1/environ'

# This only works if the onboard `ps` is **not** the one from Busybox.
ps e -p "$PID"

Further readings

Sources

All the references in the further readings section, plus the following: