Skip to content

Commit

Permalink
Merge pull request #35467 from windsonsea/initcon
Browse files Browse the repository at this point in the history
[zh-cn] resync /concepts/workloads/pods/init-containers.md
  • Loading branch information
k8s-ci-robot authored Jul 28, 2022
2 parents b62c6de + 37b1950 commit 23c8345
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/zh-cn/docs/concepts/workloads/pods/init-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ The status of the init containers is returned in `.status.initContainerStatuses`
field as an array of the container statuses (similar to the `.status.containerStatuses`
field).
-->
为 Pod 设置 Init 容器需要在 [Pod 规约](/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec)
为 Pod 设置 Init 容器需要在 [Pod 规约](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec)
中添加 `initContainers` 字段,
该字段以 [Container](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#container-v1-core)
类型对象数组的形式组织,和应用的 `containers` 数组同级相邻。
参阅 API 参考的[容器](/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)章节了解详情。
参阅 API 参考的[容器](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)章节了解详情。

Init 容器的状态在 `status.initContainerStatuses` 字段中以容器状态数组的格式返回
(类似 `status.containerStatuses` 字段)。
Expand Down Expand Up @@ -215,7 +215,7 @@ kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
app.kubernetes.io/name: MyApp
spec:
containers:
- name: myapp-container
Expand Down Expand Up @@ -284,7 +284,7 @@ The output is similar to this:
Name: myapp-pod
Namespace: default
[...]
Labels: app=myapp
Labels: app.kubernetes.io/name=MyApp
Status: Pending
[...]
Init Containers:
Expand Down Expand Up @@ -545,7 +545,7 @@ Pod 重启会导致 Init 容器重新执行,主要有如下几个原因:
* Pod 的基础设施容器 (译者注:如 `pause` 容器) 被重启。这种情况不多见,
必须由具备 root 权限访问节点的人员来完成。

*`restartPolicy` 设置为 "`Always`",Pod 中所有容器会终止而强制重启。
*`restartPolicy` 设置为 `Always`,Pod 中所有容器会终止而强制重启。
由于垃圾收集机制的原因,Init 容器的完成记录将会丢失。

<!--
Expand Down

0 comments on commit 23c8345

Please sign in to comment.