Skip to content

Commit 3be4bb5

Browse files
committed
translate Container Environment into chinese
Fix some text errors resolve conversation resolve conversation
1 parent cde3dfa commit 3be4bb5

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: 容器环境
3+
content_template: templates/concept
4+
weight: 20
5+
---
6+
7+
{{% capture overview %}}
8+
9+
<!--
10+
This page describes the resources available to Containers in the Container environment.
11+
-->
12+
本页描述了在容器环境里容器可用的资源。
13+
14+
{{% /capture %}}
15+
16+
17+
{{% capture body %}}
18+
19+
<!--
20+
## Container environment
21+
22+
The Kubernetes Container environment provides several important resources to Containers:
23+
24+
* A filesystem, which is a combination of an [image](/docs/concepts/containers/images/) and one or more [volumes](/docs/concepts/storage/volumes/).
25+
* Information about the Container itself.
26+
* Information about other objects in the cluster.
27+
-->
28+
## 容器环境
29+
30+
Kubernetes 的容器环境给容器提供了几个重要的资源:
31+
32+
* 文件系统,其中包含一个[镜像](/docs/concepts/containers/images/) 和一个或多个的[](/docs/concepts/storage/volumes/)
33+
* 容器自身的信息。
34+
* 集群中其他对象的信息。
35+
36+
<!--
37+
### Container information
38+
39+
The *hostname* of a Container is the name of the Pod in which the Container is running.
40+
It is available through the `hostname` command or the
41+
[`gethostname`](http://man7.org/linux/man-pages/man2/gethostname.2.html)
42+
function call in libc.
43+
44+
The Pod name and namespace are available as environment variables through the
45+
[downward API](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/).
46+
47+
User defined environment variables from the Pod definition are also available to the Container,
48+
as are any environment variables specified statically in the Docker image.
49+
-->
50+
### 容器信息
51+
52+
容器的 *hostname* 是它所运行在的 pod 的名称。它可以通过 `hostname` 命令或者调用 libc 中的 [`gethostname`](http://man7.org/linux/man-pages/man2/gethostname.2.html) 函数来获取。
53+
54+
Pod 名称和命名空间可以通过 [downward API](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/) 使用环境变量。
55+
56+
Pod 定义中的用户所定义的环境变量也可在容器中使用,就像在 Docker 镜像中静态指定的任何环境变量一样。
57+
58+
<!--
59+
### Cluster information
60+
61+
A list of all services that were running when a Container was created is available to that Container as environment variables.
62+
Those environment variables match the syntax of Docker links.
63+
64+
For a service named *foo* that maps to a Container named *bar*,
65+
the following variables are defined:
66+
-->
67+
### 集群信息
68+
69+
创建容器时正在运行的所有服务的列表都可用作该容器的环境变量。这些环境变量与 Docker 链接的语法匹配。
70+
71+
对于名为 *foo* 的服务,当映射到名为 *bar* 的容器时,以下变量是被定义了的:
72+
73+
```shell
74+
FOO_SERVICE_HOST=<the host the service is running on>
75+
FOO_SERVICE_PORT=<the port the service is running on>
76+
```
77+
78+
<!--
79+
Services have dedicated IP addresses and are available to the Container via DNS,
80+
if [DNS addon](http://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/dns/) is enabled. 
81+
-->
82+
Service 具有专用的 IP 地址。如果启用了 [DNS插件](http://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/dns/),就可以在容器中通过 DNS 来访问。
83+
84+
{{% /capture %}}
85+
86+
{{% capture whatsnext %}}
87+
88+
<!--
89+
* Learn more about [Container lifecycle hooks](/docs/concepts/containers/container-lifecycle-hooks/).
90+
* Get hands-on experience
91+
[attaching handlers to Container lifecycle events](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/).
92+
-->
93+
* 学习更多有关[容器生命周期钩子](/docs/concepts/containers/container-lifecycle-hooks/)的知识。
94+
* 动手获得经验[将处理程序附加到容器生命周期事件](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)
95+
96+
{{% /capture %}}

0 commit comments

Comments
 (0)