Skip to content

Write new task: Defining a Command and Arguments for a Container.#1526

Merged
pwittrock merged 4 commits intokubernetes:masterfrom
steveperry-53:task-cmd-arg
Oct 21, 2016
Merged

Write new task: Defining a Command and Arguments for a Container.#1526
pwittrock merged 4 commits intokubernetes:masterfrom
steveperry-53:task-cmd-arg

Conversation

@steveperry-53
Copy link
Copy Markdown
Contributor

@steveperry-53 steveperry-53 commented Oct 20, 2016

This change is Reviewable

@pwittrock
Copy link
Copy Markdown
Member

Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions.


docs/tasks/configure-pod-container/define-command-argument-container.md, line 26 at r1 (raw file):

containers that run in the Pod. To specify a command, include the `command`
field in the configuration file. To specify arguments for the command, include
the `args` field in the configuration file. The command that you specify in the

What does the args file override? The CMD specified in the container image? If I just specify args without command it will use the entrypoint specified the container image with the new args?


docs/tasks/configure-pod-container/define-command-argument-container.md, line 57 at r1 (raw file):

        tcp://10.3.240.1:443

{% endcapture %}

Should we mention that args + commands can not be updated once the Pod is created?


docs/tasks/configure-pod-container/define-command-argument-container.md, line 61 at r1 (raw file):

{% capture whatsnext %}

* Learn more about [containers and commands](/docs/user-guide/containers/).

args can also be set using configmaps, secrets, or environment variables. Worth mentioning these in the whatsnext section.


Comments from Reviewable

@steveperry-53
Copy link
Copy Markdown
Contributor Author

Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions.


docs/tasks/configure-pod-container/define-command-argument-container.md, line 26 at r1 (raw file):

Previously, pwittrock (Phillip Wittrock) wrote…

What does the args file override? The CMD specified in the container image? If I just specify args without command it will use the entrypoint specified the container image with the new args?

Added text about defining only args.

docs/tasks/configure-pod-container/define-command-argument-container.md, line 57 at r1 (raw file):

Previously, pwittrock (Phillip Wittrock) wrote…

Should we mention that args + commands can not be updated once the Pod is created?

Done.

docs/tasks/configure-pod-container/define-command-argument-container.md, line 61 at r1 (raw file):

Previously, pwittrock (Phillip Wittrock) wrote…

args can also be set using configmaps, secrets, or environment variables. Worth mentioning these in the whatsnext section.

Added section about using environment variables, configmaps, and secrets.

Comments from Reviewable

@pwittrock
Copy link
Copy Markdown
Member

pwittrock commented Oct 21, 2016

Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions.


docs/tasks/configure-pod-container/define-command-argument-container.md, line 75 at r2 (raw file):
I would add a special

NOTE: The environment variable appears in parenthesis "$(VAR)". This is required for the variable to be expanded in the command or args sections.

This is easy to miss as it is different from how commands are specified in bash.

Another thing I would mention is that if the user needs their command to be execute in a shell (e.g. they want to setup a pipe), then should execute it by passing it to sh like so:

["/bin/sh", "-c", "while true; do sleep 1; done"]


Added note about parentheses.
Added section about running the command in a shell.

Comments from Reviewable

@pwittrock
Copy link
Copy Markdown
Member

pwittrock commented Oct 21, 2016

Reviewed 3 of 4 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


docs/tasks/configure-pod-container/define-command-argument-container.md, line 75 at r2 (raw file):
Maybe something like:

Note: If your command should be executed in a shell you must wrap it like this:
command: ["/bin/sh"]
args: ["-c", "while true; do echo hello; sleep 10;done"]

This will be necessary for tasks such as shell scripting and piping commands together.


Added section on running the command in a shell.

Comments from Reviewable

@pwittrock
Copy link
Copy Markdown
Member

love it

@pwittrock
Copy link
Copy Markdown
Member

:lgtm:


Reviewed 1 of 1 files at r3.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


Comments from Reviewable

@pwittrock pwittrock merged commit 3b6bb3f into kubernetes:master Oct 21, 2016
@steveperry-53 steveperry-53 deleted the task-cmd-arg branch October 27, 2016 18:46
Okabe-Junya pushed a commit to Okabe-Junya/website that referenced this pull request Dec 4, 2023
* [IT] Create infrastructure-as-a-service.md

Signed-off-by: annalisag-spark <83414097+annalisag-spark@users.noreply.github.com>

* Update content/it/infrastructure-as-a-service.md

Co-authored-by: Paolo Martinoli <81316809+ugho16@users.noreply.github.com>
Signed-off-by: annalisag-spark <83414097+annalisag-spark@users.noreply.github.com>

Signed-off-by: annalisag-spark <83414097+annalisag-spark@users.noreply.github.com>
Co-authored-by: Paolo Martinoli <81316809+ugho16@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants