<p>I want to run a <code>kubernetes</code> deployment in the likes of the following:</p>

<pre><code>apiVersion: v1
kind: Deployment
metadata:
  name: my-deployment
  namespace: my-namespace
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: my-app
        image: our-own-registry.com/somerepo/my-app:${IMAGE_TAG}
        env:
        - name: FOO
          value: "BAR"
</code></pre>

<p>This will be delivered to the developers so that they can perform on demand deployments using the image tag of their preference.</p>

<p>What is best way / recommended pattern to pass the tag variable?</p>

<p>performing an export on the command line to make it available as env var on the shell from which the <code>kubectl</code> command will run?</p>

pkaramol
<p>Unfortunately, it's impossible via native kubernetes tools. From <a href="https://github.com/kubernetes/kubernetes/issues/52787" rel="nofollow noreferrer">here</a>:</p>

<blockquote>
  <p>kubectl will never support variable substitution.</p>
</blockquote>

<p>But, that issue case also has some good workarounds. The best way is deploy your apps via <code>Helm</code> <a href="https://docs.helm.sh/chart_template_guide/" rel="nofollow noreferrer">charts using templates</a></p>
