<p>I want to create config map from file with key as value of variable from kubectl tool</p>
<p>However,</p>
<pre><code>MY_VARIBLE=&quot;something&quot;
kubectl create configmap myconfigmap --from-file=${MY_VARIBLE}=myfile.json
</code></pre>
<p>does not return anything and configmap is not created</p>
<pre><code>kubectl create configmap myconfigmap --from-file=something=myfile.json
</code></pre>
<p>works correctly.
How can I workaround it? Thanks!!</p>

Кирилл Х
<p>Thank you all!
My real problem was that MY_VARIABLE had value with &quot;:&quot;
After replacing &quot;:&quot; with &quot;-&quot; everything started working correctly in any case from above</p>
