<p>What is the max size allowed for Environment variable (pod->container->Env) in kubernetes, assuming base ubuntu containers? I am unable to find the relevant documentation. Question might seem stupid, but, I do need the info to make my design robust. </p>

<p>So at bare minimum there is some 1,048,576 byte limitation imposed:</p>

<blockquote>
  <p>The ConfigMap "too-big" is invalid: []: Too long: must have at most 1048576 characters</p>
</blockquote>

<p>which I generated as:</p>

<pre class="lang-sh prettyprint-override"><code>cat &gt; too-big.yml&lt;&lt;FOO
apiVersion: v1
kind: ConfigMap
metadata:
  name: too-big
data:
  kaboom.txt: |
    $(python -c 'print("x" * 1024 * 1024)')
FOO
</code></pre>

<p>And when I try that same stunt with a Pod, I'm met with a very similar outcome:</p>

<pre><code>containers:
- image: ubuntu:18.10
  env:
  - name: TOO_BIG
    value: |
      $(python -c the same print)
</code></pre>

<blockquote>
  <p>standard_init_linux.go:178: exec user process caused "argument list too long"</p>
</blockquote>

<p>So I would guess it's somewhere in between those two numbers: 0 and 1048576</p>

<p>That said, as the <a href="https://stackoverflow.com/questions/1078031/what-is-the-maximum-size-of-an-environment-variable-value">practically duplicate question</a> answered, you are very, very likely solving the wrong problem. The very fact that you have to come to a community site to ask such a question means you are brining risk to your project that it will work one way on Linux, another way on docker, another way on kubernetes, and a different way on macOS.</p>
