<p>How to set env with dashes?</p>
<p>I execute the command:</p>
<pre><code>kubectl set env deployment/service &quot;--cron.updates=0 */10 8-9 * * *&quot; 
</code></pre>
<p>And get error:</p>
<blockquote>
<p>Error: unknown flag: --cron.full-update-check-status See 'oc set env
--help' for usage.</p>
</blockquote>
<p>How to add environment to service with dashes?</p>

lampa
<p><strong>Solution-1:</strong></p>
<p>Use single quotes</p>
<pre><code>kubectl set env deployment/foo  -- &quot;--cron.updates='0 */10 8-9 * * *'&quot;
</code></pre>
<p>This would change the <code>env</code> of the <code>pod</code> to:</p>
<pre><code>k exec -it foo-78fff84996-5mskb -- printenv |grep cron.updates
--cron.updates='0 */10 8-9 * * *'
</code></pre>
<p><strong>Solution-2:</strong></p>
<p>Disable <code>glob</code> , which would prevent use of single quotes.</p>
<p>You may disable <code>glob</code> and do the following:</p>
<pre><code>set -f #disable glob
kubectl set env deployment/foo  -- &quot;--cron.updates1=0 */10 8-9 * * *&quot;
set +f #enable glob
</code></pre>
<p>This would also work, example output:</p>
<pre><code>k exec -it foo-5d4998668b-6gc9j  -- printenv |grep cron.updates
--cron.updates='0 */10 8-9 * * *'
--cron.updates1=0 */10 8-9 * * *
</code></pre>
