Update define-environment-variable-container.md
This commit is contained in:
+3
-17
@@ -76,21 +76,12 @@ Pod:
|
|||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
1. Get a shell to the container running in your Pod:
|
1. List the Pod's container environment variables:
|
||||||
-->
|
-->
|
||||||
1. 进入该 Pod 下的容器并打开一个命令终端:
|
1. 列出 Pod 容器的环境变量:
|
||||||
|
|
||||||
```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.
|
|
||||||
-->
|
|
||||||
1. 在命令终端中通过执行 `printenv` 打印出环境变量。
|
|
||||||
|
|
||||||
```shell
|
|
||||||
root@envar-demo:/# printenv
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -107,11 +98,6 @@ Pod:
|
|||||||
DEMO_FAREWELL=Such a sweet sorrow
|
DEMO_FAREWELL=Such a sweet sorrow
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
|
||||||
1. To exit the shell, enter `exit`.
|
|
||||||
-->
|
|
||||||
1. 通过键入 `exit` 退出命令终端。
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
The environment variables set using the `env` or `envFrom` field
|
The environment variables set using the `env` or `envFrom` field
|
||||||
|
|||||||
Reference in New Issue
Block a user