Skip to content

Commit 754db53

Browse files
authored
Merge pull request #25089 from scoulomb-dup-fork/cm-cmd-args
Improve configmap usage as pod command and args
2 parents 8d225a1 + 1ec78b1 commit 754db53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ This functionality is available in Kubernetes v1.6 and later.
532532

533533
## Use ConfigMap-defined environment variables in Pod commands
534534

535-
You can use ConfigMap-defined environment variables in the `command` section of the Pod specification using the `$(VAR_NAME)` Kubernetes substitution syntax.
535+
You can use ConfigMap-defined environment variables in the `command` and `args` of a container using the `$(VAR_NAME)` Kubernetes substitution syntax.
536536

537537
For example, the following Pod specification
538538

content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spec:
66
containers:
77
- name: test-container
88
image: k8s.gcr.io/busybox
9-
command: [ "/bin/sh", "-c", "echo $(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
9+
command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ]
1010
env:
1111
- name: SPECIAL_LEVEL_KEY
1212
valueFrom:

0 commit comments

Comments
 (0)