@@ -3,7 +3,6 @@ title: 垃圾收集
33content_type : concept
44weight : 70
55---
6-
76<!--
87title: Garbage Collection
98content_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/)
240238resource 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,
293291and 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