<p>I'm trying to config my Selenium Grid (chart) via Helm cli (can't override values.yaml at this level.. have to use helm cli&quot;), and i need to add the next env var:
<code>SE_NODE_MAX_SESSIONS=5</code>
I tried to command this:
<code>--set chromeNode.replicas=5 \ --set chromeNode.extraEnvironmentVariables='[&quot;SE_NODE_MAX_SESSIONS&quot;=&quot;5&quot;]' \</code>
but it doesn't work..</p>
<pre><code>Error: UPGRADE FAILED: error validating &quot;&quot;: error validating data: ValidationError(Deployment.spec.template.spec.containers[0].env): invalid type for io.k8s.api.core.v1.Container.env: got &quot;string&quot;, expected &quot;array&quot;

</code></pre>
<p>what is the right way to add/override this env var?</p>
<p><code>--set chromeNode.extraEnvironmentVariables='[&quot;SE_NODE_MAX_SESSIONS&quot;=&quot;5&quot;]' \ </code>
expecting for sucessfull deployment</p>
<p>Link for chart: <a href="https://github.com/SeleniumHQ/docker-selenium/tree/trunk/charts/selenium-grid" rel="nofollow noreferrer">https://github.com/SeleniumHQ/docker-selenium/tree/trunk/charts/selenium-grid</a></p>

Dolev Shoval
<p>Looking at the Chart you linked, the value <em>chromeNode.extraEnvironmentalVariables</em> calls for a Kubernetes classic array of envs with its classic structure [ name: <em>env_name</em>, value: <em>env_value</em> ].</p>
<p>According to the <a href="https://helm.sh/docs/helm/helm_install/" rel="nofollow noreferrer">Helm Official Documentation</a>, you have two possible solutions.</p>
<p>If you have <strong>Helm &gt;= 2.5</strong> you can use the <a href="https://helm.sh/docs/chart_best_practices/values/#consider-how-users-will-use-your-values" rel="nofollow noreferrer">flat array technique</a> using this notation in your command line:</p>
<pre><code>helm install --set chromeNode.extraEnvironmentVariables[0].name=&quot;SE_NODE_MAX_SESSIONS&quot; --set chromeNode.extraEnvironmentVariables[0].value=5
</code></pre>
<p>Clearly, the downside is that you have to pick an array index value arbitrarily.</p>
<p>If you have <strong>Helm &gt;=3.0</strong> you can use the <strong>--set-json</strong> option and notate everything in JSON as per the official documentations suggest.</p>
<pre><code>helm install --set-json 'chromeNode.extraEnvironmentVariables=[{&quot;name&quot;:&quot;SE_NODE_MAX_SESSIONS&quot;,&quot;value&quot;:&quot;5&quot;}]'
</code></pre>
<p>A belate response but a response anyway.</p>
