<p>Is it possible for an InitContainer to change the environment variables of the application container when running inside the same Pod?</p>

<p>Note that I am looking for a detailed answer that describes the technical reasons why this is or isn't possible. Example: 'Current container technology supports environment variable isolation between containers and Pods cannot bypass that restriction by "grouping" containers in the same "environment variable space"'.</p>

atomaras
<p>Short answer is No, they can't.</p>

<p>You can try some hack something using <a href="https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/" rel="nofollow noreferrer">ShareProcessNamespace</a> and <a href="https://stackoverflow.com/questions/205064/is-there-a-way-to-change-the-environment-variables-of-another-process-in-unix">gdb</a> but for sure this is not correct solution for problem you are trying to solve.</p>
