Skip to content

Commit 4b6dc01

Browse files
authored
Merge pull request #47293 from asa3311/sync-zh-135
[zh] sync container-lifecycle-hooks custom-resources security-context
2 parents 4bb42f2 + b034462 commit 4b6dc01

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

content/zh-cn/docs/concepts/containers/container-lifecycle-hooks.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,14 @@ the Kubernetes management system executes the handler according to the hook acti
121121
`httpGet``tcpSocket``sleep` 由 kubelet 进程执行,而 `exec` 在容器中执行。
122122

123123
<!--
124-
Hook handler calls are synchronous within the context of the Pod containing the Container.
125-
This means that for a `PostStart` hook,
126-
the Container ENTRYPOINT and hook fire asynchronously.
127-
However, if the hook takes too long to run or hangs,
128-
the Container cannot reach a `running` state.
129-
-->
130-
回调处理程序调用在包含容器的 Pod 上下文中是同步的。
131-
这意味着对于 `PostStart` 回调,容器入口点和回调异步触发。
132-
但是,如果回调运行或挂起的时间太长,则容器无法达到 `running` 状态。
124+
The `PostStart` hook handler call is initiated when a container is created,
125+
meaning the container ENTRYPOINT and the `PostStart` hook are triggered simultaneously.
126+
However, if the `PostStart` hook takes too long to execute or if it hangs,
127+
it can prevent the container from transitioning to a `running` state.
128+
-->
129+
当容器创建时,会调用 `PostStart` 回调程序,
130+
这意味着容器的 ENTRYPOINT 和 `PostStart` 回调会同时触发。然而,
131+
如果 `PostStart` 回调程序执行时间过长或挂起,它可能会阻止容器进入 `running` 状态。
133132

134133
<!--
135134
`PreStop` hooks are not executed asynchronously from the signal

content/zh-cn/docs/concepts/extend-kubernetes/api-extension/custom-resources.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,20 @@ The [CustomResourceDefinition](/docs/tasks/extend-kubernetes/custom-resources/cu
315315
API resource allows you to define custom resources.
316316
Defining a CRD object creates a new custom resource with a name and schema that you specify.
317317
The Kubernetes API serves and handles the storage of your custom resource.
318-
The name of a CRD object must be a valid
319-
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
318+
The name of the CRD object itself must be a valid
319+
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names) derived from the defined resource name and its API group; see [how to create a CRD](/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions#create-a-customresourcedefinition) for more details.
320+
Further, the name of an object whose kind/resource is defined by a CRD must also be a valid DNS subdomain name.
320321
-->
321322
## CustomResourceDefinitions
322323

323324
[CustomResourceDefinition](/zh-cn/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)
324325
API 资源允许你定义定制资源。
325326
定义 CRD 对象的操作会使用你所设定的名字和模式定义(Schema)创建一个新的定制资源,
326327
Kubernetes API 负责为你的定制资源提供存储和访问服务。
327-
CRD 对象的名称必须是合法的
328-
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
328+
CRD 对象的名称必须是有效的 [DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
329+
该名称由定义的资源名称及其 API 组派生而来。有关详细信息,
330+
请参见[如何创建 CRD](/zh-cn/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions#create-a-customresourcedefinition)
331+
此外,由 CRD 定义的某种对象/资源的名称也必须是有效的 DNS 子域名。
329332

330333
<!--
331334
This frees you from writing your own API server to handle the custom resource,
@@ -434,6 +437,7 @@ Aggregated APIs offer more advanced API features and customization of other feat
434437
| strategic-merge-patch | The new endpoints support PATCH with `Content-Type: application/strategic-merge-patch+json`. Useful for updating objects that may be modified both locally, and by the server. For more information, see ["Update API Objects in Place Using kubectl patch"](/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/) | No | Yes |
435438
| Protocol Buffers | The new resource supports clients that want to use Protocol Buffers | No | Yes |
436439
| OpenAPI Schema | Is there an OpenAPI (swagger) schema for the types that can be dynamically fetched from the server? Is the user protected from misspelling field names by ensuring only allowed fields are set? Are types enforced (in other words, don't put an `int` in a `string` field?) | Yes, based on the [OpenAPI v3.0 validation](/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation) schema (GA in 1.16). | Yes |
440+
| Instance Name | Does this extension mechanism impose any constraints on the names of objects whose kind/resource is defined this way? | Yes, such an object's name must be a valid DNS subdomain name. | No |
437441
-->
438442
| 特性 | 描述 | CRD | 聚合 API |
439443
| ------- | ----------- | ---- | -------------- |
@@ -448,6 +452,7 @@ Aggregated APIs offer more advanced API features and customization of other feat
448452
| strategic-merge-patch | 新的端点要支持标记了 `Content-Type: application/strategic-merge-patch+json` 的 PATCH 操作。对于更新既可在本地更改也可在服务器端更改的对象而言是有用的。要了解更多信息,可参见[使用 `kubectl patch` 来更新 API 对象](/zh-cn/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/)| 不可以。 | 可以。 |
449453
| 支持协议缓冲区 | 新的资源要支持想要使用协议缓冲区(Protocol Buffer)的客户端。 | 不可以。 | 可以。 |
450454
| OpenAPI Schema | 是否存在新资源类别的 OpenAPI(Swagger)Schema 可供动态从服务器上读取?是否存在机制确保只能设置被允许的字段以避免用户犯字段拼写错误?是否实施了字段类型检查(换言之,不允许在 `string` 字段设置 `int` 值)? | 可以,依据 [OpenAPI v3.0 合法性检查](/zh-cn/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation) 模式(1.16 中进入正式发布状态)。 | 可以。|
455+
| 实例名称 | 这种扩展机制是否对通过这种方式定义的对象(类别/资源)的名称有任何限制? | 可以,此类对象的名称必须是一个有效的 DNS 子域名。 | 不可以|
451456

452457
<!--
453458
### Common Features

content/zh-cn/docs/tasks/configure-pod-container/security-context.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ them. The list of masked and read-only paths are as follows:
833833
- `/proc/sched_debug`
834834
- `/proc/scsi`
835835
- `/sys/firmware`
836+
- `/sys/devices/virtual/powercap`
836837

837838
<!--
838839
- Read-Only Paths:

0 commit comments

Comments
 (0)