Answers: <p>You can include the arguments in the deployment yaml.  The <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow noreferrer">official docs</a> include examples and further customization.</p>
  
  <pre><code>spec:
     containers:
       image: myimage
       name: myContainerName
       args: ["me", "yes", "https://my.url"]</code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2020-01-31T20:23:08.347Z
Answers: 2020-01-31T20:23:08.347Z
Answers: Wesley Rolnick
Body: <p><strong>Background</strong></p>
  
  <p>I have a docker container that I run in the following fashion:  </p>
  
  <p><code>docker run --rm my-custom-container:latest --username me --password yes --url "https://my.url"</code></p>
  
  <p>The container does what what it needs to do with no issues.</p>
  
  <p>I have pushed my container image to a private image repository, and I am able to create a Kubernetes deployment. Kubernetes is able to pull the container from the private image repository for the container with no problems.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>However, when Kubernetes goes to start the container it returns with an error stating that it cannot run the container.</p>
  
  <p>This is due to a lack of parameters being passed to the container to run.</p>
  
  <p><strong>Question</strong></p>
  
  <p>How do I pass parameters to my container during a Kubernetes deployment?</p>
  
Comments: CC BY-SA 4.0
Comments: 2020-01-31T08:31:53.823Z
Comments: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/
Comments: Yuri G.
Tags: <docker><kubernetes><containers><configuration><orchestration>
Title: How to pass parameters to a container orchestrated by Kubernetes similar to running the container at the command line using the docker run command?
UserDisplayName: Dodzi Dzakuma
ThreadText: # How to pass parameters to a container orchestrated by Kubernetes similar to running the container at the command line using the docker run command?
  
  (Asked by: username_0 on 2020-01-31)
  
  **Background**
  
  I have a docker container that I run in the following fashion:
  
  `docker run --rm my-custom-container:latest --username me --password yes --url "https://my.url"`
  
  The container does what what it needs to do with no issues.
  
  I have pushed my container image to a private image repository, and I am able to create a Kubernetes deployment. Kubernetes is able to pull the container from the private image repository for the container with no problems.
  
  **Problem**
  
  However, when Kubernetes goes to start the container it returns with an error stating that it cannot run the container.
  
  This is due to a lack of parameters being passed to the container to run.
  
  **Question**
  
  How do I pass parameters to my container during a Kubernetes deployment?
  
  **Tags:** docker, kubernetes, containers, configuration, orchestration
  
  > **Comments:**
  > **username_1**: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-01-31. Score: 2 | Accepted answer
  
  You can include the arguments in the deployment yaml. The [official docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/) include examples and further customization.
  
  ```
  spec:
     containers:
       image: myimage
       name: myContainerName
       args: ["me", "yes", "https://my.url"]
  ```
  
  
  ---
  
  