From 5ea52bba520ab601b36d01d5787e445fdac45697 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sun, 16 Jul 2023 22:40:23 +0200 Subject: [PATCH] refactor: moved kb article where it belongs --- ...vironment of processes running in containers.md} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename knowledge base/{kubernetes/get the environment of a process running in a container.md => get the environment of processes running in containers.md} (70%) diff --git a/knowledge base/kubernetes/get the environment of a process running in a container.md b/knowledge base/get the environment of processes running in containers.md similarity index 70% rename from knowledge base/kubernetes/get the environment of a process running in a container.md rename to knowledge base/get the environment of processes running in containers.md index ef0646e..476f888 100644 --- a/knowledge base/kubernetes/get the environment of a process running in a container.md +++ b/knowledge base/get the environment of processes running in containers.md @@ -1,4 +1,4 @@ -# Get the environment of a process running in a container +# Get the environment of processes running in containers ## Table of contents @@ -9,13 +9,14 @@ ## TL;DR ```sh -cat /proc/${PID}/environ +# From a shell inside the container. +cat "/proc/${PID}/environ" -# Container in kubernetes. -kubectl exec pod-name -- cat /proc/1/environ +# In Kubernetes. +kubectl exec 'pod-name' -- cat '/proc/1/environ' -# Only works if the onboard `ps` is not from busybox. -ps e -p $PID +# This only works if the onboard `ps` is **not** the one from Busybox. +ps e -p "$PID" ``` ## Further readings