From dccbc5f3cd17175a231013a0b6ff0c52cc9232f1 Mon Sep 17 00:00:00 2001 From: Max Belsky Date: Thu, 22 Oct 2020 16:42:36 +0300 Subject: [PATCH 1/2] Reduce steps count to list the env vars --- .../define-environment-variable-container.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md b/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md index cbc3c45260..e31b711ad7 100644 --- a/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md +++ b/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md @@ -47,17 +47,10 @@ Pod: envar-demo 1/1 Running 0 9s ``` -1. Get a shell to the container running in your Pod: +1. List the pod's container environment variables: ```shell - kubectl exec -it envar-demo -- /bin/bash - ``` - -1. In your shell, run the `printenv` command to list the environment variables. - - ```shell - # Run this in the shell inside the container - printenv + kubectl exec envar-demo -- printenv ``` The output is similar to this: @@ -71,8 +64,6 @@ Pod: DEMO_FAREWELL=Such a sweet sorrow ``` -1. To exit the shell, enter `exit`. - {{< note >}} The environment variables set using the `env` or `envFrom` field override any environment variables specified in the container image. From 8cc80bf4699d5ce17208411bb8ede93e561db9c4 Mon Sep 17 00:00:00 2001 From: Max Belsky Date: Fri, 23 Oct 2020 10:51:14 +0300 Subject: [PATCH 2/2] Update content/en/docs/tasks/inject-data-application/define-environment-variable-container.md Co-authored-by: Tim Bannister --- .../define-environment-variable-container.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md b/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md index e31b711ad7..9cefdca03d 100644 --- a/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md +++ b/content/en/docs/tasks/inject-data-application/define-environment-variable-container.md @@ -47,7 +47,7 @@ Pod: envar-demo 1/1 Running 0 9s ``` -1. List the pod's container environment variables: +1. List the Pod's container environment variables: ```shell kubectl exec envar-demo -- printenv @@ -113,4 +113,3 @@ Upon creation, the command `echo Warm greetings to The Most Honorable Kubernetes * Learn about [using secrets as environment variables](/docs/concepts/configuration/secret/#using-secrets-as-environment-variables). * See [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core). -