@@ -46,7 +46,8 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
4646
4747- ** metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a >)
4848
49- 标准的对象元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
49+ 标准的对象元数据,更多信息:
50+ https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
5051
5152<!--
5253- **webhooks** ([]ValidatingWebhook)
@@ -65,7 +66,7 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
6566
6667 ** 补丁策略:根据 ` name ` 键执行合并操作**
6768
68- ** Map:name 键的唯一值将在合并期间保留**
69+ ** Map:` name ` 键的唯一值将在合并期间保留**
6970
7071 webhooks 是 Webhook 以及受影响的资源和操作的列表。
7172
@@ -84,7 +85,7 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
8485
8586 ** Atomic:将在合并期间被替换**
8687
87- admissionReviewVersions 是 Webhook 期望的首选 ` AdmissionReview ` 版本的有序列表。
88+ ` admissionReviewVersions ` 是 Webhook 期望的优选 AdmissionReview 版本的有序列表。
8889 API 服务器将尝试使用它支持的列表中的第一个版本。如果 API 服务器不支持此列表中指定的版本,则此对象将验证失败。
8990 如果持久化的 Webhook 配置指定了允许的版本,并且不包括 API 服务器已知的任何版本,则对 Webhook 的调用将失败并受失败策略的约束。
9091
@@ -99,7 +100,7 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
99100
100101 - ** webhooks.clientConfig** (WebhookClientConfig),必需
101102
102- clientConfig 定义了如何与 Webhook 通信。必需。
103+ ` clientConfig ` 定义了如何与 Webhook 通信。必需。
103104
104105 <a name =" WebhookClientConfig " ></a >
105106 ** WebhookClientConfig 包含与 Webhook 建立 TLS 连接的信息**
@@ -172,7 +173,8 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
172173
173174 - ** webhooks.clientConfig.service.port** (int32)
174175
175- 如果指定,则为托管 Webhook 的服务上的端口。默认为 443 以实现向后兼容性。` port ` 应该是一个有效的端口号(包括 1-65535)。
176+ 如果指定,则为托管 Webhook 的服务上的端口。默认为 443 以实现向后兼容性。
177+ ` port ` 应该是一个有效的端口号(包括 1-65535)。
176178
177179 <!--
178180 - **webhooks.clientConfig.url** (string)
@@ -215,8 +217,8 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
215217
216218 - ** webhooks.name** (string),必需
217219
218- 准入 Webhook 的名称。应该是完全限定的名称,例如 imagepolicy.kubernetes.io,其中 “imagepolicy” 是 Webhook 的名称,
219- kubernetes.io 是组织的名称。必需。
220+ 准入 Webhook 的名称。应该是完全限定的名称,例如 ` imagepolicy.kubernetes.io ` ,其中 “imagepolicy” 是 Webhook 的名称,
221+ ` kubernetes.io ` 是组织的名称。必需。
220222
221223 <!--
222224 - **webhooks.sideEffects** (string), required
@@ -226,19 +228,44 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
226228
227229 - ** webhooks.sideEffects** (string),必需
228230
229- sideEffects 说明此 Webhook 是否有副作用。可接受的值为:None、NoneOnDryRun(通过 v1beta1 创建的 Webhook 也可以指定 Some 或 Unknown)。
231+ ` sideEffects ` 说明此 Webhook 是否有副作用。可接受的值为:None、NoneOnDryRun(通过 v1beta1 创建的 Webhook 也可以指定 Some 或 Unknown)。
230232 具有副作用的 Webhook 必须实现协调系统,因为请求可能会被准入链中的未来步骤拒绝,因此需要能够撤消副作用。
231- 如果请求与带有 sideEffects == Unknown 或 Some 的 Webhook 匹配,则带有 dryRun 属性的请求将被自动拒绝。
233+ 如果请求与带有 ` sideEffects ` 为 “Unknown” 或 “Some” 的 Webhook 匹配,则带有 dryRun 属性的请求将被自动拒绝。
234+
235+ <!--
236+ Possible enum values:
237+ - `"None"` means that calling the webhook will have no side effects.
238+ - `"NoneOnDryRun"` means that calling the webhook will possibly have side effects, but if the request being reviewed has the dry-run attribute, the side effects will be suppressed.
239+ - `"Some"` means that calling the webhook will possibly have side effects. If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
240+ - `"Unknown"` means that no information is known about the side effects of calling the webhook. If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
241+ -->
242+
243+ 可能的枚举值:
244+ - ` "None" ` 表示调用 Webhook 不会产生副作用。
245+ - ` "NoneOnDryRun" ` 表示调用 Webhook 可能会有副作用,但如果被审查的请求具有
246+ ` dry-run ` 属性,则会抑制这些副作用。
247+ - ` "Some" ` 表示调用 Webhook 可能会有副作用。如果带有 ` dry-run ` 属性的请求会触发对此
248+ Webhook 的调用,该请求将会失败。
249+ - ` "Unknown" ` 表示对调用 Webhook 的副作用不了解。如果带有 ` dry-run ` 属性的请求会触发对此
250+ Webhook 的调用,该请求将会失败。
232251
233252 <!--
234253 - **webhooks.failurePolicy** (string)
235254
236255 FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.
256+
257+ Possible enum values:
258+ - `"Fail"` means that an error calling the webhook causes the admission to fail.
259+ - `"Ignore"` means that an error calling the webhook is ignored.
237260 -->
238261 - ** webhooks.failurePolicy** (string)
239262
240- failurePolicy 定义了如何处理来自准入端点的无法识别的错误 - 允许的值是 Ignore 或 Fail。默认为 Fail。
263+ ` failurePolicy ` 定义了如何处理来自准入端点的无法识别的错误 - 允许的值是 Ignore 或 Fail。默认为 Fail。
241264
265+ 可能的枚举值:
266+ - ` "Fail" ` 表示调用 Webhook 发生错误时,准入操作将失败。
267+ - ` "Ignore" ` 表示调用 Webhook 发生错误时,该错误将被忽略。
268+
242269 <!--
243270 - **webhooks.matchConditions** ([]MatchCondition)
244271
@@ -250,14 +277,14 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
250277
251278 ** 补丁策略:根据 ` name ` 键的取值合并**
252279
253- ** Map:name 键的唯一值将在合并期间保留**
280+ ** Map:` name ` 键的唯一值将在合并期间保留**
254281
255282 <!--
256283 MatchConditions is a list of conditions that must be met for a request to be sent to this webhook. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.
257284 -->
258- matchConditions 是将请求发送到此 webhook 之前必须满足的条件列表。
285+ ` matchConditions ` 是将请求发送到此 webhook 之前必须满足的条件列表。
259286 匹配条件过滤已经被 rules、namespaceSelector、objectSelector 匹配的请求。
260- matchConditions 取值为空列表时匹配所有请求。最多允许 64 个匹配条件。
287+ ` matchConditions ` 取值为空列表时匹配所有请求。最多允许 64 个匹配条件。
261288
262289 <!--
263290 The exact matching logic is (in order):
@@ -268,18 +295,18 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
268295 - If failurePolicy=Ignore, the error is ignored and the webhook is skipped
269296 -->
270297 精确匹配逻辑是(按顺序):
271- 1 . 如果任一 matchCondition 的计算结果为 FALSE,则跳过该 webhook。
272- 2 . 如果所有 matchConditions 的计算结果为 TRUE,则调用该 webhook。
273- 3 . 如果任一 matchCondition 的计算结果为错误(但都不是 FALSE):
274- - 如果 failurePolicy=Fail,拒绝该请求;
275- - 如果 failurePolicy=Ignore,忽略错误并跳过该 webhook。
298+ 1 . 如果任一 ` matchCondition ` 的计算结果为 FALSE,则跳过该 webhook。
299+ 2 . 如果所有 ` matchConditions ` 的计算结果为 TRUE,则调用该 webhook。
300+ 3 . 如果任一 ` matchCondition ` 的计算结果为错误(但都不是 FALSE):
301+ - 如果 ` failurePolicy=Fail ` ,拒绝该请求;
302+ - 如果 ` failurePolicy=Ignore ` ,忽略错误并跳过该 webhook。
276303
277304 <!--
278305 <a name="MatchCondition"></a>
279306 *MatchCondition represents a condition which must by fulfilled for a request to be sent to a webhook.*
280307 -->
281308 <a name =" MatchCondition " ></a >
282- ** MatchCondition 表示将请求发送到 Webhook 之前必须满足的条件。**
309+ ** ` MatchCondition ` 表示将请求发送到 Webhook 之前必须满足的条件。**
283310
284311 <!--
285312 - **webhooks.matchConditions.expression** (string), required
@@ -288,7 +315,7 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
288315 -->
289316 - ** webhooks.matchConditions.expression** (string),必需
290317
291- expression 表示将由 CEL 求值的表达式。求值结果必须是 bool 值。CEL 表达式可以访问
318+ ` expression ` 表示将由 CEL 求值的表达式。求值结果必须是 bool 值。CEL 表达式可以访问
292319 以 CEL 变量的形式给出的 AdmissionRequest 和 Authorizer 的内容:
293320
294321 <!--
@@ -327,11 +354,11 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
327354 -->
328355 - ** webhooks.matchConditions.name** (string),必需
329356
330- name 是此匹配条件的标识符,用于 MatchConditions 的策略性合并,
331- 以及提供用于日志目的的标识符。一个好的 name 应该是对相关表达式的描述。
332- name 必须是由字母数字字符 ` - ` 、` _ ` 或 ` . ` 组成的限定名称,
357+ ` name ` 是此匹配条件的标识符,用于 ` matchConditions ` 的策略性合并,
358+ 以及提供用于日志目的的标识符。一个好的 ` name ` 应该是对相关表达式的描述。
359+ ` name ` 必须是由字母数字字符 ` - ` 、` _ ` 或 ` . ` 组成的限定名称,
333360 并且必须以字母、数字字符开头和结尾(例如 ` MyName ` 、` my.name ` 或 ` 123-abc ` ,
334- 用于验证 name 的正则表达式是 ` ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] ` )。
361+ 用于验证 ` name ` 的正则表达式是 ` ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] ` )。
335362 带有可选的 DNS 子域前缀和 ` / ` (例如 ` example.com/MyName ` )
336363
337364 此字段为必需字段。
@@ -350,33 +377,44 @@ ValidatingWebhookConfiguration 描述准入 Webhook 的配置,此 Webhook
350377
351378 - ** webhooks.matchPolicy** (string)
352379
353- matchPolicy 定义了如何使用 "rules" 列表来匹配传入的请求。允许的值为 "Exact" 或 "Equivalent"。
380+ ` matchPolicy ` 定义了如何使用 "rules" 列表来匹配传入的请求。允许的值为 "Exact" 或 "Equivalent"。
354381
355382 - Exact: 仅当请求与指定规则完全匹配时才匹配请求。
356- 例如,如果可以通过 apps/v1、 apps/v1beta1 和 extensions/v1beta1 修改 deployments 资源,
383+ 例如,如果可以通过 ` apps/v1 ` 、 ` apps/v1beta1 ` 和 ` extensions/v1beta1 ` 修改 Deployment 资源,
357384 但 “rules” 仅包含 ` apiGroups:["apps"]、apiVersions:["v1"]、resources:["deployments "] ` ,
358- 对 apps/v1beta1 或 extensions/v1beta1 的请求不会被发送到 Webhook。
385+ 对 ` apps/v1beta1 ` 或 ` extensions/v1beta1 ` 的请求不会被发送到 Webhook。
359386
360387 - Equivalent: 如果针对的资源包含在 “rules” 中,即使是通过另一个 API 组或版本,也视作匹配请求。
361388 例如,如果可以通过 apps/v1、apps/v1beta1 和 extensions/v1beta1 修改 deployments 资源,
362389 并且 “rules” 仅包含 ` apiGroups:["apps"]、apiVersions:["v1"]、resources:["deployments "] ` ,
363- 对 apps/v1beta1 或 extensions/v1beta1 的请求将被转换为 apps/v1 并发送到 Webhook。
390+ 对 ` apps/v1beta1 ` 或 ` extensions/v1beta1 ` 的请求将被转换为 ` apps/v1 ` 并发送到 Webhook。
364391
365392 默认为 “Equivalent”。
366393
394+ <!--
395+ Possible enum values:
396+ - `"Equivalent"` means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
397+ - `"Exact"` means requests should only be sent to the webhook if they exactly match a given rule.
398+ -->
399+
400+ 可能的枚举值:
401+ - ` "Equivalent" ` 表示如果请求通过另一个 API 组或版本修改了规则中列出的资源,
402+ 则应将请求发送到 Webhook。
403+ - ` "Exact" ` 表示仅当请求完全匹配给定规则时,才应将请求发送到 Webhook。
404+
367405 - ** webhooks.namespaceSelector** (<a href="{{< ref "../common-definitions/label-selector#LabelSelector" >}}">LabelSelector</a >)
368406
369407 <!--
370408 NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.
371409
372410 For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows:
373411 -->
374- namespaceSelector 根据对象的命名空间是否与 selector 匹配来决定是否在该对象上运行 Webhook。
375- 如果对象本身是命名空间,则在 object.metadata.labels 上执行匹配。
412+ ` namespaceSelector ` 根据对象的命名空间是否与 selector 匹配来决定是否在该对象上运行 Webhook。
413+ 如果对象本身是命名空间,则在 ` object.metadata.labels ` 上执行匹配。
376414 如果对象是另一个集群范围的资源,则永远不会跳过 Webhook 执行匹配。
377415
378416 例如,在命名空间与 “0” 或 “1” 的 “runlevel” 不关联的任何对象上运行 Webhook;
379- 你可以按如下方式设置 selector :
417+ 你可以按如下方式设置 selector:
380418 ```
381419 "namespaceSelector": {
382420 "matchExpressions": [
0 commit comments