@@ -44,7 +44,7 @@ Kubernetes 的容器环境给容器提供了几个重要的资源:
44
44
45
45
The *hostname* of a Container is the name of the Pod in which the Container is running.
46
46
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)
48
48
function call in libc.
49
49
50
50
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.
55
55
-->
56
56
### 容器信息
57
57
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 ) 函数可以获取该名称 。
60
60
61
61
Pod 名称和命名空间可以通过
62
62
[ 下行 API] ( /zh-cn/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/ )
@@ -78,11 +78,11 @@ the following variables are defined:
78
78
创建容器时正在运行的所有服务都可用作该容器的环境变量。
79
79
这里的服务仅限于新容器的 Pod 所在的名字空间中的服务,以及 Kubernetes 控制面的服务。
80
80
81
- 对于名为 * foo* 的服务,当映射到名为 * bar* 的容器时,以下变量是被定义了的 :
81
+ 对于名为 ** foo** 的服务,当映射到名为 ** bar** 的容器时,定义了以下变量 :
82
82
83
83
``` 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=< 其上服务正运行的端口 >
86
86
```
87
87
88
88
<!--
@@ -100,7 +100,7 @@ if [DNS addon](https://releases.k8s.io/{{< param "fullversion" >}}/cluster/addon
100
100
* Get hands-on experience
101
101
[attaching handlers to Container lifecycle events](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/).
102
102
-->
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/ ) 。
105
105
106
106
0 commit comments