Merge pull request #24685 from mbelsky/mbelsky-patch-1
Reduce steps count to list the env vars
This commit is contained in:
+2
-12
@@ -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.
|
||||
@@ -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).
|
||||
* See [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core).
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user