Skip to content

Commit 79552a5

Browse files
authored
Merge pull request #33258 from my-git9/podindexmd
[zh] Update workloads/pods/_index.md
2 parents 5f77c3e + 4993a0d commit 79552a5

File tree

1 file changed

+39
-11
lines changed
  • content/zh/docs/concepts/workloads/pods

1 file changed

+39
-11
lines changed

content/zh/docs/concepts/workloads/pods/_index.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,37 @@ Pod 的共享上下文包括一组 Linux 名字空间、控制组(cgroup)和
9292
<!--
9393
## Using Pods
9494
95+
The following is an example of a Pod which consists of a container running the image `nginx:1.14.2`.
96+
97+
{{< codenew file="pods/simple-pod.yaml" >}}
98+
99+
To create the Pod shown above, run the following command:
100+
-->
101+
## 使用 Pod {#using-pods}
102+
103+
下面是一个 Pod 示例,它由一个运行镜像 `nginx:1.14.2` 的容器组成。
104+
105+
{{< codenew file="pods/simple-pod.yaml" >}}
106+
107+
要创建上面显示的 Pod,请运行以下命令:
108+
109+
```shell
110+
kubectl apply -f https://k8s.io/examples/pods/simple-pod.yaml
111+
```
112+
113+
<!--
114+
Pods are generally not created directly and are created using workload resources.
115+
See [Working with Pods](#working-with-pods) for more information on how Pods are used
116+
with workload resources.
117+
118+
### Workload resources for managing pods
119+
-->
120+
Pod 通常不是直接创建的,而是使用工作负载资源创建的。
121+
有关如何将 Pod 用于工作负载资源的更多信息,请参阅 [使用 Pod](#working-with-pods)
122+
123+
### 用于管理 pod 的工作负载资源
124+
125+
<!--
95126
Usually you don't need to create Pods directly, even singleton Pods.
96127
Instead, create them using workload resources such as {{< glossary_tooltip text="Deployment"
97128
term_id="deployment" >}} or {{< glossary_tooltip text="Job" term_id="job" >}}.
@@ -100,8 +131,6 @@ If your Pods need to track state, consider the
100131
101132
Pods in a Kubernetes cluster are used in two main ways:
102133
-->
103-
## 使用 Pod {#using-pods}
104-
105134
通常你不需要直接创建 Pod,甚至单实例 Pod。
106135
相反,你会使用诸如
107136
{{< glossary_tooltip text="Deployment" term_id="deployment" >}} 或
@@ -187,9 +216,9 @@ that updates those files from a remote source, as in the following diagram:
187216
-->
188217

189218
例如,你可能有一个容器,为共享卷中的文件提供 Web 服务器支持,以及一个单独的
190-
“sidecar(挂斗)”容器负责从远端更新这些文件,如下图所示:
219+
"边车 (sidercar)" 容器负责从远端更新这些文件,如下图所示:
191220

192-
{{< figure src="/images/docs/pod.svg" alt="example pod diagram" width="50%" >}}
221+
{{< figure src="/images/docs/pod.svg" alt="Pod creation diagram" class="diagram-medium" >}}
193222

194223
<!--
195224
Some Pods have {{< glossary_tooltip text="init containers" term_id="init-container" >}}
@@ -287,7 +316,7 @@ _Pod 模板(Pod Template)_ 来替你创建 Pod 并管理它们。
287316
Pod 模板是包含在工作负载对象中的规范,用来创建 Pod。这类负载资源包括
288317
[Deployment](/zh/docs/concepts/workloads/controllers/deployment/)
289318
[Job](/zh/docs/concepts/workloads/controllers/job/)
290-
[DaemonSets](/zh/docs/concepts/workloads/controllers/daemonset/)等。
319+
[DaemonSets](/zh/docs/concepts/workloads/controllers/daemonset/) 等。
291320

292321
<!--
293322
Each controller for a workload resource uses the `PodTemplate` inside the workload
@@ -314,7 +343,7 @@ spec:
314343
spec:
315344
containers:
316345
- name: hello
317-
image: busybox
346+
image: busybox:1.28
318347
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 3600']
319348
restartPolicy: OnFailure
320349
# 以上为 Pod 模版
@@ -345,7 +374,7 @@ details are abstracted away. That abstraction and separation of concerns simplif
345374
system semantics, and makes it feasible to extend the cluster's behavior without
346375
changing existing code.
347376
-->
348-
在节点上,{{< glossary_tooltip term_id="kubelet" text="kubelet" >}}并不直接监测
377+
在节点上,{{< glossary_tooltip term_id="kubelet" text="kubelet" >}} 并不直接监测
349378
或管理与 Pod 模版相关的细节或模版的更新,这些细节都被抽象出来。
350379
这种抽象和关注点分离简化了整个系统的语义,并且使得用户可以在不改变现有代码的
351380
前提下就能扩展集群的行为。
@@ -412,7 +441,7 @@ Kubernetes 并不禁止你直接管理 Pod。对运行中的 Pod 的某些字段
412441
Pods enable data sharing and communication among their constituent
413442
containters.
414443
-->
415-
### 资源共享和通信 {#resource-sharing-and-communication}
444+
### 资源共享和通信 {#resource-sharing-and-communication}
416445

417446
Pod 使它的成员容器间能够进行数据共享和通信。
418447

@@ -459,14 +488,13 @@ can find each other via `localhost`. The containers in a Pod can also communicat
459488
with each other using standard inter-process communications like SystemV semaphores
460489
or POSIX shared memory. Containers in different Pods have distinct IP addresses
461490
and can not communicate by IPC without
462-
[special configuration](/docs/concepts/policy/pod-security-policy/).
491+
and can not communicate by OS-level IPC without special configuration.
463492
Containers that want to interact with a container running in a different Pod can
464493
use IP networking to communicate.
465494
-->
466495
在同一个 Pod 内,所有容器共享一个 IP 地址和端口空间,并且可以通过 `localhost` 发现对方。
467496
他们也能通过如 SystemV 信号量或 POSIX 共享内存这类标准的进程间通信方式互相通信。
468-
不同 Pod 中的容器的 IP 地址互不相同,没有
469-
[特殊配置](/zh/docs/concepts/policy/pod-security-policy/) 就不能使用 IPC 进行通信。
497+
不同 Pod 中的容器的 IP 地址互不相同,没有特殊配置,无法通过 OS 级 IPC 进行通信就不能使用 IPC 进行通信。
470498
如果某容器希望与运行于其他 Pod 中的容器通信,可以通过 IP 联网的方式实现。
471499

472500
<!--

0 commit comments

Comments
 (0)