From 1ec78b1f28ee8ed5fa2d0a17aee21514c8eb75c8 Mon Sep 17 00:00:00 2001 From: Sylvain COULOMBEL Date: Tue, 17 Nov 2020 21:54:25 +0100 Subject: [PATCH] Improve configmap usage as pod command and args --- .../tasks/configure-pod-container/configure-pod-configmap.md | 2 +- content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md b/content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md index 42eff59db0..2824cce642 100644 --- a/content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md +++ b/content/en/docs/tasks/configure-pod-container/configure-pod-configmap.md @@ -532,7 +532,7 @@ This functionality is available in Kubernetes v1.6 and later. ## Use ConfigMap-defined environment variables in Pod commands -You can use ConfigMap-defined environment variables in the `command` section of the Pod specification using the `$(VAR_NAME)` Kubernetes substitution syntax. +You can use ConfigMap-defined environment variables in the `command` and `args` of a container using the `$(VAR_NAME)` Kubernetes substitution syntax. For example, the following Pod specification diff --git a/content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml b/content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml index a72b4335ce..00827ec98a 100644 --- a/content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml +++ b/content/en/examples/pods/pod-configmap-env-var-valueFrom.yaml @@ -6,7 +6,7 @@ spec: containers: - name: test-container image: k8s.gcr.io/busybox - command: [ "/bin/sh", "-c", "echo $(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] + command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] env: - name: SPECIAL_LEVEL_KEY valueFrom: