Merge pull request #24685 from mbelsky/mbelsky-patch-1

Reduce steps count to list the env vars
This commit is contained in:
Kubernetes Prow Robot
2020-10-25 04:21:00 -07:00
committed by GitHub
@@ -47,17 +47,10 @@ Pod:
envar-demo 1/1 Running 0 9s 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 ```shell
kubectl exec -it envar-demo -- /bin/bash kubectl exec envar-demo -- printenv
```
1. In your shell, run the `printenv` command to list the environment variables.
```shell
# Run this in the shell inside the container
printenv
``` ```
The output is similar to this: The output is similar to this:
@@ -71,8 +64,6 @@ Pod:
DEMO_FAREWELL=Such a sweet sorrow DEMO_FAREWELL=Such a sweet sorrow
``` ```
1. To exit the shell, enter `exit`.
{{< note >}} {{< note >}}
The environment variables set using the `env` or `envFrom` field The environment variables set using the `env` or `envFrom` field
override any environment variables specified in the container image. override any environment variables specified in the container image.
@@ -122,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). * 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). * See [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core).