Skip to content

Commit fe00518

Browse files
authored
Merge pull request #24685 from mbelsky/mbelsky-patch-1
Reduce steps count to list the env vars
2 parents 58bcaff + 8cc80bf commit fe00518

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

content/en/docs/tasks/inject-data-application/define-environment-variable-container.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,10 @@ Pod:
4747
envar-demo 1/1 Running 0 9s
4848
```
4949

50-
1. Get a shell to the container running in your Pod:
50+
1. List the Pod's container environment variables:
5151
5252
```shell
53-
kubectl exec -it envar-demo -- /bin/bash
54-
```
55-
56-
1. In your shell, run the `printenv` command to list the environment variables.
57-
58-
```shell
59-
# Run this in the shell inside the container
60-
printenv
53+
kubectl exec envar-demo -- printenv
6154
```
6255
6356
The output is similar to this:
@@ -71,8 +64,6 @@ Pod:
7164
DEMO_FAREWELL=Such a sweet sorrow
7265
```
7366
74-
1. To exit the shell, enter `exit`.
75-
7667
{{< note >}}
7768
The environment variables set using the `env` or `envFrom` field
7869
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
122113
* Learn about [using secrets as environment variables](/docs/concepts/configuration/secret/#using-secrets-as-environment-variables).
123114
* See [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core).
124115
125-

0 commit comments

Comments
 (0)