0

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?

1

You can include the arguments in the deployment yaml. The official docs include examples and further customization.

spec:
   containers:
     image: myimage
     name: myContainerName
     args: ["me", "yes", "https://my.url"]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.