Skip to content

Commit c43e929

Browse files
authored
Merge pull request #35639 from windsonsea/conenv
[zh-cn] updated /containers/container-environment.md
2 parents 0ae7021 + ce1057b commit c43e929

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/zh-cn/docs/concepts/containers/container-environment.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Kubernetes 的容器环境给容器提供了几个重要的资源:
4444
4545
The *hostname* of a Container is the name of the Pod in which the Container is running.
4646
It is available through the `hostname` command or the
47-
[`gethostname`](http://man7.org/linux/man-pages/man2/gethostname.2.html)
47+
[`gethostname`](https://man7.org/linux/man-pages/man2/gethostname.2.html)
4848
function call in libc.
4949
5050
The Pod name and namespace are available as environment variables through the
@@ -55,8 +55,8 @@ as are any environment variables specified statically in the container image.
5555
-->
5656
### 容器信息
5757

58-
容器的 *hostname* 是它所运行在的 pod 的名称。它可以通过 `hostname` 命令或者调用 libc 中的
59-
[`gethostname`](https://man7.org/linux/man-pages/man2/gethostname.2.html) 函数来获取
58+
一个容器的 **hostname** 是该容器运行所在的 Pod 的名称。通过 `hostname` 命令或者调用 libc 中的
59+
[`gethostname`](https://man7.org/linux/man-pages/man2/gethostname.2.html) 函数可以获取该名称
6060

6161
Pod 名称和命名空间可以通过
6262
[下行 API](/zh-cn/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/)
@@ -78,11 +78,11 @@ the following variables are defined:
7878
创建容器时正在运行的所有服务都可用作该容器的环境变量。
7979
这里的服务仅限于新容器的 Pod 所在的名字空间中的服务,以及 Kubernetes 控制面的服务。
8080

81-
对于名为 *foo* 的服务,当映射到名为 *bar* 的容器时,以下变量是被定义了的
81+
对于名为 **foo** 的服务,当映射到名为 **bar** 的容器时,定义了以下变量
8282

8383
```shell
84-
FOO_SERVICE_HOST=<the host the service is running on>
85-
FOO_SERVICE_PORT=<the port the service is running on>
84+
FOO_SERVICE_HOST=<其上服务正运行的主机>
85+
FOO_SERVICE_PORT=<其上服务正运行的端口>
8686
```
8787

8888
<!--
@@ -100,7 +100,7 @@ if [DNS addon](https://releases.k8s.io/{{< param "fullversion" >}}/cluster/addon
100100
* Get hands-on experience
101101
[attaching handlers to Container lifecycle events](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/).
102102
-->
103-
* 学习更多有关[容器生命周期回调](/zh-cn/docs/concepts/containers/container-lifecycle-hooks/)的知识
104-
* 动手[为容器生命周期事件添加处理程序](/zh-cn/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)
103+
* 学习更多有关[容器生命周期回调](/zh-cn/docs/concepts/containers/container-lifecycle-hooks/)的知识
104+
* 动手[为容器的生命周期事件设置处理函数](/zh-cn/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)
105105

106106

0 commit comments

Comments
 (0)