Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes pod commands and args

Tags:

kubernetes

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"
like image 317
quicksilver Avatar asked Oct 24 '25 01:10

quicksilver


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.

like image 86
coderanger Avatar answered Oct 25 '25 21:10

coderanger