<p>Can I pass environment variable when use <code>kubectl apply -f file.yaml</code> like <code>kubectl apply -f file.yaml -env HOST=dev.api.host.com</code>?</p>

<p>Because I have a file yaml, and I need to run in two pipelines, in one case to use host for production and in another case to use host for developlemnt.</p>

<p>I don't want to use two different files, I want to use one file, where I'll replace the host.</p>

<p>Is it possible?</p>

<p>This is how you should update environment variables in deployment yaml.</p>

<pre><code>export TAG="1.11.1"
export NAME=my-nginx
envsubst &lt; deployment.yaml | kubectl apply -f -
</code></pre>
