<p>I have a bash script in a Docker image to which I can pass a command line argument through <code>docker run</code> (having specified the bash script in <code>ENTRYPOINT</code> and a default parameter in <code>CMD</code> like in this <a href="https://stackoverflow.com/a/40312311/7869068">answer</a>). So I would run something like</p>

<pre><code>docker run my_docker_test argument_1
</code></pre>

<p>Now I would like to deploy multiple (ca. 50) containers to OpenShift or Kubernetes, each with a different value of the argument. I understand that in Kubernetes I could specify the <code>command</code> and <code>args</code> in the object configuration yaml file. Is there a possibility to pass the argument directly from the command line like in <code>docker run</code>, e.g. passing to <code>kubectl</code> or <code>oc</code>, without the need to create a new yaml file each time I want to change the value of the argument?</p>

<p>The right answer is from @Jonas but you can also use environment variables in your yaml file as stated <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#use-environment-variables-to-define-arguments" rel="noreferrer">below</a>:</p>

<blockquote>
  <p>As an alternative to providing strings directly, you can define arguments by using environment variables</p>
</blockquote>

<pre><code>env:
- name: ARGUMENT
  value: {{ argument_1 }}
args: ["$(ARGUMENT)"]
</code></pre>

<p>Where {{ argument_1 }} is an environment variable.</p>
