Skip to content

Commit 1efee2c

Browse files
committed
[zh] Sync architecture/garbage-collection.md
1 parent c47f47b commit 1efee2c

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

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

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: 垃圾收集
33
content_type: concept
44
weight: 70
55
---
6-
76
<!--
87
title: Garbage Collection
98
content_type: concept
@@ -105,7 +104,7 @@ You can check for that kind of Event by running
105104
-->
106105
在 1.20 及更高版本中,如果垃圾收集器检测到非法的跨名字空间 `ownerReference`
107106
或者某集群作用域的依赖对象的 `ownerReference` 引用某名字空间作用域的类别,
108-
系统会生成一个警告事件,其原因为 `OwnerRefInvalidNamespace``involvedObject`
107+
系统会生成一个警告事件,其原因为 `OwnerRefInvalidNamespace``involvedObject`
109108
设置为非法的依赖对象。你可以通过运行
110109
`kubectl get events -A --field-selector=reason=OwnerRefInvalidNamespace`
111110
来检查是否存在这类事件。
@@ -201,8 +200,7 @@ to learn more.
201200
默认情况下,Kubernetes 使用后台级联删除方案,除非你手动设置了要使用前台删除,
202201
或者选择遗弃依赖对象。
203202

204-
参阅[使用后台级联删除](/zh-cn/docs/tasks/administer-cluster/use-cascading-deletion/#use-background-cascading-deletion)
205-
以了解进一步的细节。
203+
参阅[使用后台级联删除](/zh-cn/docs/tasks/administer-cluster/use-cascading-deletion/#use-background-cascading-deletion)以了解进一步的细节。
206204

207205
<!--
208206
### Orphaned dependents
@@ -214,8 +212,8 @@ to override this behaviour, see [Delete owner objects and orphan dependents](/do
214212
### 被遗弃的依赖对象 {#orphaned-dependents}
215213

216214
当 Kubernetes 删除某个属主对象时,被留下来的依赖对象被称作被遗弃的(Orphaned)对象。
217-
默认情况下,Kubernetes 会删除依赖对象。要了解如何重载这种默认行为,可参阅
218-
[删除属主对象和遗弃依赖对象](/zh-cn/docs/tasks/administer-cluster/use-cascading-deletion/#set-orphan-deletion-policy)
215+
默认情况下,Kubernetes 会删除依赖对象。要了解如何重载这种默认行为,
216+
可参阅[删除属主对象和遗弃依赖对象](/zh-cn/docs/tasks/administer-cluster/use-cascading-deletion/#set-orphan-deletion-policy)
219217

220218
<!--
221219
## Garbage collection of unused containers and images {#containers-images}
@@ -239,8 +237,8 @@ and change the parameters related to garbage collection using the
239237
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)
240238
resource type.
241239
-->
242-
要配置对未使用容器和镜像的垃圾收集选项,可以使用一个
243-
[配置文件](/zh-cn/docs/tasks/administer-cluster/kubelet-config-file/),基于
240+
要配置对未使用容器和镜像的垃圾收集选项,
241+
可以使用一个[配置文件](/zh-cn/docs/tasks/administer-cluster/kubelet-config-file/),基于
244242
[`KubeletConfiguration`](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)
245243
资源类型来调整与垃圾收集相关的 kubelet 行为。
246244

@@ -292,16 +290,35 @@ To configure the setting, enable the `ImageMaximumGCAge`
292290
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the kubelet,
293291
and also set a value for the `ImageMaximumGCAge` field in the kubelet configuration file.
294292
-->
295-
请为 kubelet 启用 `ImageMaximumGCAge`
293+
请为 kubelet 启用 `ImageMaximumGCAge`
296294
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
297295
并在 kubelet 配置文件中为 `ImageMaximumGCAge` 字段赋值来配置该设置。
298296

299297
<!--
300-
The value is specified as a Kubernetes _duration_; for example, you can set the configuration
301-
field to `3d12h`, which means 3 days and 12 hours.
298+
The value is specified as a Kubernetes _duration_;
299+
Valid time units for the `ImageMaximumGCAge` field in the kubelet configuration file are:
300+
- "ns" for nanoseconds
301+
- "us" or "µs" for microseconds
302+
- "ms" for milliseconds
303+
- "s" for seconds
304+
- "m" for minutes
305+
- "h" for hours
306+
-->
307+
该值应遵循 Kubernetes **持续时间(Duration)** 格式;
308+
在 kubelet 配置文件中,`ImageMaximumGCAge` 字段的有效时间单位如下:
309+
310+
- "ns" 表示纳秒
311+
- "us" 或 "µs" 表示微秒
312+
- "ms" 表示毫秒
313+
- "s" 表示秒
314+
- "m" 表示分钟
315+
- "h" 表示小时
316+
317+
<!--
318+
For example, you can set the configuration field to `12h45m`,
319+
which means 12 hours and 45 minutes.
302320
-->
303-
该值应遵循 Kubernetes __持续时间(Duration)__ 格式;例如,你可以将配置字段设置为 `3d12h`
304-
代表 3 天 12 小时。
321+
例如,你可以将配置字段设置为 `12h45m`,代表 12 小时 45 分钟。
305322

306323
{{< note >}}
307324
<!--

0 commit comments

Comments
 (0)