Kubernetes pod commands and args

Viewed 837

What is the purpose of args if one could specify all arguments using command in kubernetes manifest file? for example i can use below syntax which totally negates the usage of the args.

command: [ "bin/bash", "-c", "mycommand" ]

or also

command:
  - "bin/bash"
  - "-c"
  - "mycommand"
1 Answers

The main reason to use args: instead of command: is if the container has a specific entrypoint directive that you don't want to change. For example if the Dockerfile has ENTRYPOINT ["/myapp"] you might put args: [--log-level=debug] to add that one argument without changing the path to the binary. In many cases it isn't relevant though and you just use command: to do it all at once.

Related