Skip to content

Commit 0dc7f17

Browse files
committed
[zh-cn]sync manage-resources-containers garbage-collection nodes logging job
Signed-off-by: xin.li <[email protected]>
1 parent a72cd0c commit 0dc7f17

File tree

6 files changed

+59
-52
lines changed

6 files changed

+59
-52
lines changed

content/zh-cn/docs/concepts/architecture/garbage-collection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ two types of cascading deletion, as follows:
127127

128128
Kubernetes 会检查并删除那些不再拥有属主引用的对象,例如在你删除了 ReplicaSet
129129
之后留下来的 Pod。当你删除某个对象时,你可以控制 Kubernetes 是否去自动删除该对象的依赖对象,
130-
这个过程称为 **级联删除(Cascading Deletion)**
130+
这个过程称为**级联删除(Cascading Deletion)**
131131
级联删除有两种类型,分别如下:
132132

133133
* 前台级联删除
@@ -236,12 +236,12 @@ break the kubelet behavior and remove containers that should exist.
236236
To configure options for unused container and image garbage collection, tune the
237237
kubelet using a [configuration file](/docs/tasks/administer-cluster/kubelet-config-file/)
238238
and change the parameters related to garbage collection using the
239-
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
239+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)
240240
resource type.
241241
-->
242242
要配置对未使用容器和镜像的垃圾收集选项,可以使用一个
243243
[配置文件](/zh-cn/docs/tasks/administer-cluster/kubelet-config-file/),基于
244-
[`KubeletConfiguration`](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
244+
[`KubeletConfiguration`](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
245245
资源类型来调整与垃圾收集相关的 kubelet 行为。
246246

247247
<!--

content/zh-cn/docs/concepts/architecture/nodes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ register itself with the API server. This is the preferred pattern, used by most
142142
143143
For self-registration, the kubelet is started with the following options:
144144
-->
145-
### 节点自注册 {#self-registration-of-nodes}
145+
### 节点自注册 {#self-registration-of-nodes}
146146

147147
当 kubelet 标志 `--register-node` 为 true(默认)时,它会尝试向 API 服务注册自己。
148148
这是首选模式,被绝大多数发行版选用。
@@ -942,10 +942,10 @@ in a cluster,
942942
|`regular/unset` | 0 |
943943

944944
<!--
945-
Within the [kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
945+
Within the [kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/)
946946
the settings for `shutdownGracePeriodByPodPriority` could look like:
947947
-->
948-
[kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)中,
948+
[kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)中,
949949
`shutdownGracePeriodByPodPriority` 可能看起来是这样:
950950

951951
| Pod 优先级类数值 | 关闭期限 |
@@ -1073,7 +1073,7 @@ VolumeAttachments will not be deleted from the original shutdown node so the vol
10731073
used by these pods cannot be attached to a new running node. As a result, the
10741074
application running on the StatefulSet cannot function properly. If the original
10751075
shutdown node comes up, the pods will be deleted by kubelet and new pods will be
1076-
created on a different running node. If the original shutdown node does not come up,
1076+
created on a different running node. If the original shutdown node does not come up,
10771077
these pods will be stuck in terminating status on the shutdown node forever.
10781078
-->
10791079
当某节点关闭但 kubelet 的节点关闭管理器未检测到这一事件时,
@@ -1150,12 +1150,12 @@ onwards, swap memory support can be enabled on a per-node basis.
11501150
<!--
11511151
To enable swap on a node, the `NodeSwap` feature gate must be enabled on
11521152
the kubelet, and the `--fail-swap-on` command line flag or `failSwapOn`
1153-
[configuration setting](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
1153+
[configuration setting](/docs/reference/config-api/kubelet-config.v1beta1/)
11541154
must be set to false.
11551155
-->
11561156
要在节点上启用交换内存,必须启用 kubelet 的 `NodeSwap` 特性门控,
11571157
同时使用 `--fail-swap-on` 命令行参数或者将 `failSwapOn`
1158-
[配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)设置为 false。
1158+
[配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)设置为 false。
11591159

11601160
{{< warning >}}
11611161
<!--

content/zh-cn/docs/concepts/cluster-administration/logging.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl
132132
133133
![Node level logging](/images/docs/user-guide/logging/logging-node-level.png)
134134
135-
A container runtime handles and redirects any output generated to a containerized application's `stdout` and `stderr` streams.
136-
Different container runtimes implement this in different ways; however, the integration with the kubelet is standardized
137-
as the _CRI logging format_.
135+
A container runtime handles and redirects any output generated to a containerized
136+
application's `stdout` and `stderr` streams.
137+
Different container runtimes implement this in different ways; however, the integration
138+
with the kubelet is standardized as the _CRI logging format_.
138139
-->
139140
### 节点的容器日志处理方式 {#how-nodes-handle-container-logs}
140141

@@ -144,11 +145,11 @@ as the _CRI logging format_.
144145
不同的容器运行时以不同的方式实现这一点;不过它们与 kubelet 的集成都被标准化为 **CRI 日志格式**
145146

146147
<!--
147-
By default, if a container restarts, the kubelet keeps one terminated container with its logs. If a pod is evicted from the node,
148-
all corresponding containers are also evicted, along with their logs.
148+
By default, if a container restarts, the kubelet keeps one terminated container with its logs.
149+
If a pod is evicted from the node, all corresponding containers are also evicted, along with their logs.
149150
150-
The kubelet makes logs available to clients via a special feature of the Kubernetes API. The usual way to access this is
151-
by running `kubectl logs`.
151+
The kubelet makes logs available to clients via a special feature of the Kubernetes API.
152+
The usual way to access this is by running `kubectl logs`.
152153
-->
153154
默认情况下,如果容器重新启动,kubelet 会保留一个终止的容器及其日志。
154155
如果一个 Pod 被逐出节点,所对应的所有容器及其日志也会被逐出。
@@ -176,7 +177,7 @@ and the runtime writes the container logs to the given location.
176177
kubelet(使用 CRI)将此信息发送到容器运行时,而运行时则将容器日志写到给定位置。
177178

178179
<!--
179-
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration),
180+
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/),
180181
`containerLogMaxSize` and `containerLogMaxFiles`,
181182
using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/).
182183
These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively.
@@ -185,7 +186,7 @@ When you run [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands
185186
the basic logging example, the kubelet on the node handles the request and
186187
reads directly from the log file. The kubelet returns the content of the log file.
187188
-->
188-
你可以使用 [kubelet 配置文件](/zh-cn/docs/tasks/administer-cluster/kubelet-config-file/)配置两个
189+
你可以使用 [kubelet 配置文件](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)配置两个
189190
kubelet [配置选项](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration)
190191
`containerLogMaxSize``containerLogMaxFiles`
191192
这些设置分别允许你分别配置每个日志文件大小的最大值和每个容器允许的最大文件数。
@@ -353,7 +354,8 @@ as your responsibility.
353354
<!--
354355
## Cluster-level logging architectures
355356
356-
While Kubernetes does not provide a native solution for cluster-level logging, there are several common approaches you can consider. Here are some options:
357+
While Kubernetes does not provide a native solution for cluster-level logging, there are
358+
several common approaches you can consider. Here are some options:
357359
358360
* Use a node-level logging agent that runs on every node.
359361
* Include a dedicated sidecar container for logging in an application pod.
@@ -378,9 +380,12 @@ While Kubernetes does not provide a native solution for cluster-level logging, t
378380
![使用节点级日志代理](/images/docs/user-guide/logging/logging-with-node-agent.png)
379381

380382
<!--
381-
You can implement cluster-level logging by including a _node-level logging agent_ on each node. The logging agent is a dedicated tool that exposes logs or pushes logs to a backend. Commonly, the logging agent is a container that has access to a directory with log files from all of the application containers on that node.
383+
You can implement cluster-level logging by including a _node-level logging agent_ on each node.
384+
The logging agent is a dedicated tool that exposes logs or pushes logs to a backend.
385+
Commonly, the logging agent is a container that has access to a directory with log files from all of the
386+
application containers on that node.
382387
-->
383-
你可以通过在每个节点上使用 **节点级的日志记录代理** 来实现集群级日志记录。
388+
你可以通过在每个节点上使用**节点级的日志记录代理**来实现集群级日志记录。
384389
日志记录代理是一种用于暴露日志或将日志推送到后端的专用工具。
385390
通常,日志记录代理程序是一个容器,它可以访问包含该节点上所有应用程序容器的日志文件的目录。
386391

@@ -395,7 +400,8 @@ Node-level logging creates only one agent per node and doesn't require any chang
395400
节点级日志在每个节点上仅创建一个代理,不需要对节点上的应用做修改。
396401

397402
<!--
398-
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.
403+
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects
404+
these logs and forwards them for aggregation.
399405
-->
400406
容器向标准输出和标准错误输出写出数据,但在格式上并不统一。
401407
节点级代理收集这些日志并将其进行转发以完成汇总。
@@ -654,4 +660,3 @@ Cluster-logging that exposes or pushes logs directly from every application is o
654660
* 阅读有关 [Kubernetes 系统日志](/zh-cn/docs/concepts/cluster-administration/system-logs/)的信息
655661
* 进一步了解[追踪 Kubernetes 系统组件](/zh-cn/docs/concepts/cluster-administration/system-traces/)
656662
* 了解当 Pod 失效时如何[定制 Kubernetes 记录的终止消息](/zh-cn/docs/tasks/debug/debug-application/determine-reason-pod-failure/#customizing-the-termination-message)
657-

content/zh-cn/docs/concepts/configuration/manage-resources-containers.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ feature:
2222
<!-- overview -->
2323

2424
<!--
25-
When you specify a {{< glossary_tooltip term_id="pod" >}}, you can optionally specify how
26-
much of each resource a {{< glossary_tooltip text="container" term_id="container" >}} needs.
27-
The most common resources to specify are CPU and memory (RAM); there are others.
25+
When you specify a {{< glossary_tooltip term_id="pod" >}}, you can optionally specify how much of each resource a
26+
{{< glossary_tooltip text="container" term_id="container" >}} needs. The most common resources to specify are CPU and memory
27+
(RAM); there are others.
2828
2929
When you specify the resource _request_ for containers in a Pod, the
30-
{{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}} uses this
31-
information to decide which node to place the Pod on. When you specify a resource _limit_
32-
for a container, the kubelet enforces those limits so that the running container is not
33-
allowed to use more of that resource than the limit you set. The kubelet also reserves
34-
at least the _request_ amount of that system resource specifically for that container
35-
to use.
30+
{{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}} uses this information to decide which node to place the Pod on.
31+
When you specify a resource _limit_ for a container, the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} enforces those
32+
limits so that the running container is not allowed to use more of that resource
33+
than the limit you set. The kubelet also reserves at least the _request_ amount of
34+
that system resource specifically for that container to use.
3635
-->
3736
当你定义 {{< glossary_tooltip text="Pod" term_id="pod" >}} 时可以选择性地为每个
3837
{{< glossary_tooltip text="容器" term_id="container" >}}设定所需要的资源数量。
3938
最常见的可设定资源是 CPU 和内存(RAM)大小;此外还有其他类型的资源。
4039

41-
当你为 Pod 中的 Container 指定了资源 __请求__ 时,
40+
当你为 Pod 中的 Container 指定了资源 **request(请求)**时,
4241
{{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}
4342
就利用该信息决定将 Pod 调度到哪个节点上。
44-
当你还为 Container 指定了资源 __限制__ 时,kubelet 就可以确保运行的容器不会使用超出所设限制的资源。
45-
kubelet 还会为容器预留所 __请求__ 数量的系统资源,供其使用。
43+
当你为 Container 指定了资源 **limit(限制)**时,{{< glossary_tooltip text="kubelet" term_id="kubelet" >}}
44+
就可以确保运行的容器不会使用超出所设限制的资源。
45+
kubelet 还会为容器预留所 **request(请求)**数量的系统资源,供其使用。
4646

4747
<!-- body -->
4848

content/zh-cn/docs/concepts/workloads/controllers/job.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,6 @@ Jobs with _fixed completion count_ - that is, jobs that have non null
448448
the deterministic hostnames to address each other via DNS. For more information about
449449
how to configure this, see [Job with Pod-to-Pod Communication](/docs/tasks/job/job-with-pod-to-pod-communication/).
450450
- From the containerized task, in the environment variable `JOB_COMPLETION_INDEX`.
451-
452-
The Job is considered complete when there is one successfully completed Pod
453-
for each index. For more information about how to use this mode, see
454-
[Indexed Job for Parallel Processing with Static Work Assignment](/docs/tasks/job/indexed-parallel-processing-static/).
455-
Note that, although rare, more than one Pod could be started for the same
456-
index, but only one of them will count towards the completion count.
457451
-->
458452
- `NonIndexed`(默认值):当成功完成的 Pod 个数达到 `.spec.completions`
459453
设值时认为 Job 已经完成。换言之,每个 Job 完成事件都是独立无关且同质的。
@@ -467,11 +461,27 @@ Jobs with _fixed completion count_ - that is, jobs that have non null
467461
有关如何配置的更多信息,请参阅[带 Pod 间通信的 Job](/zh-cn/docs/tasks/job/job-with-pod-to-pod-communication/)
468462
- 对于容器化的任务,在环境变量 `JOB_COMPLETION_INDEX` 中。
469463

464+
<!--
465+
The Job is considered complete when there is one successfully completed Pod
466+
for each index. For more information about how to use this mode, see
467+
[Indexed Job for Parallel Processing with Static Work Assignment](/docs/tasks/job/indexed-parallel-processing-static/).
468+
-->
470469
当每个索引都对应一个成功完成的 Pod 时,Job 被认为是已完成的。
471470
关于如何使用这种模式的更多信息,可参阅
472471
[用带索引的 Job 执行基于静态任务分配的并行处理](/zh-cn/docs/tasks/job/indexed-parallel-processing-static/)
473-
需要注意的是,对同一索引值可能被启动的 Pod 不止一个,尽管这种情况很少发生。
474-
这时,只有一个会被记入完成计数中。
472+
473+
{{< note >}}
474+
<!--
475+
Although rare, more than one Pod could be started for the same index (due to various reasons such as node failures,
476+
kubelet restarts, or Pod evictions). In this case, only the first Pod that completes successfully will
477+
count towards the completion count and update the status of the Job. The other Pods that are running
478+
or completed for the same index will be deleted by the Job controller once they are detected.
479+
-->
480+
带同一索引值启动的 Pod 可能不止一个(由于节点故障、kubelet
481+
重启或 Pod 驱逐等各种原因),尽管这种情况很少发生。
482+
在这种情况下,只有第一个成功完成的 Pod 才会被记入完成计数中并更新作业的状态。
483+
其他为同一索引值运行或完成的 Pod 一旦被检测到,将被 Job 控制器删除。
484+
{{< /note >}}
475485

476486
<!--
477487
## Handling Pod and container failures
@@ -697,7 +707,7 @@ Job 将被标记为失败。以下是 `main` 容器的具体规则:
697707
- 退出码 42 代表**整个 Job** 失败
698708
- 所有其他退出码都代表容器失败,同时也代表着整个 Pod 失效。
699709
如果重启总次数低于 `backoffLimit` 定义的次数,则会重新启动 Pod,
700-
如果等于 `backoffLimit` 所设置的次数,则代表 **整个 Job** 失效。
710+
如果等于 `backoffLimit` 所设置的次数,则代表**整个 Job** 失效。
701711

702712
{{< note >}}
703713
<!--

content/zh-cn/docs/reference/tools/map-crictl-dockercli.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ weight: 10
1212

1313
{{% thirdparty-content %}}
1414

15-
{{<note>}}
16-
<!--
17-
This page is deprecated and will be removed in Kubernetes 1.27.
18-
-->
19-
此页面已被废弃,将在 Kubernetes 1.27 版本删除。
20-
{{</note>}}
21-
2215
<!--
2316
`crictl` is a command-line interface for {{<glossary_tooltip term_id="cri" text="CRI">}}-compatible container runtimes.
2417
You can use it to inspect and debug container runtimes and applications on a
@@ -151,4 +144,3 @@ crictl | 描述
151144
`rmp` | 删除一个或多个 Pod
152145
`stopp` | 停止一个或多个运行中的 Pod
153146
{{< /table >}}
154-

0 commit comments

Comments
 (0)