Files
oam/knowledge base/kubernetes/get the environment of a process running in a container.md

883 B

Get the environment of a process running in a container

Table of contents

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

TL;DR

cat /proc/${PID}/environ

# Container in kubernetes.
kubectl exec pod-name -- cat /proc/1/environ

# Only works if the onboard `ps` is not from busybox.
ps e -p $PID

Further readings

Sources

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