Skip to content

Commit 5373053

Browse files
authored
Merge pull request #35893 from 0xff-dev/main
[zh] add missing tags
2 parents da6dc8c + 7c7c848 commit 5373053

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

content/zh-cn/docs/reference/access-authn-authz/extensible-admission-controllers.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This page describes how to build, configure, use, and monitor admission webhooks
2424
<!--
2525
## What are admission webhooks?
2626
-->
27-
## 什么是准入 Webhook?
27+
## 什么是准入 Webhook? {#what-are-admission-webhooks}
2828

2929
<!--
3030
Admission webhooks are HTTP callbacks that receive admission requests and do
@@ -65,7 +65,7 @@ guides](/docs/reference/access-authn-authz/extensible-admission-controllers/#wri
6565
instructions if you intend to write/deploy production-grade admission webhooks.
6666
In the following, we describe how to quickly experiment with admission webhooks.
6767
-->
68-
### 尝试准入 Webhook
68+
### 尝试准入 Webhook {#experimenting-with-admission-webhooks}
6969

7070
准入 Webhook 本质上是集群控制平面的一部分。你应该非常谨慎地编写和部署它们。
7171
如果你打算编写或者部署生产级准入 webhook,请阅读[用户指南](/zh-cn/docs/reference/access-authn-authz/extensible-admission-controllers/#write-an-admission-webhook-server)以获取相关说明。
@@ -92,7 +92,7 @@ In the following, we describe how to quickly experiment with admission webhooks.
9292
<!--
9393
### Write an admission webhook server
9494
-->
95-
### 编写一个准入 Webhook 服务器
95+
### 编写一个准入 Webhook 服务器 {#write-an-admission-webhook-server}
9696

9797
<!--
9898
Please refer to the implementation of the [admission webhook server](https://github.com/kubernetes/kubernetes/blob/release-1.21/test/images/agnhost/webhook/main.go)
@@ -132,7 +132,7 @@ how to [authenticate API servers](#authenticate-apiservers).
132132
<!--
133133
### Deploy the admission webhook service
134134
-->
135-
### 部署准入 Webhook 服务
135+
### 部署准入 Webhook 服务 {#deploy-the-admission-webhook-service}
136136

137137
<!--
138138
The webhook server in the e2e test is deployed in the Kubernetes cluster, via
@@ -157,7 +157,7 @@ your webhook configurations accordingly.
157157
<!--
158158
### Configure admission webhooks on the fly
159159
-->
160-
### 即时配置准入 Webhook
160+
### 即时配置准入 Webhook {#configure-admission-webhooks-on-the-fly}
161161

162162
<!--
163163
You can dynamically configure what resources are subject to what admission
@@ -380,6 +380,9 @@ Of course you need to set up the webhook server to handle these authentication r
380380
-->
381381
当然,你需要设置 Webhook 服务器来处理这些身份验证请求。
382382
383+
<!-- ## Webhook request and response -->
384+
## Webhook 请求与响应 {#webhook-request-and-response}
385+
383386
<!--
384387
### Request
385388
@@ -1058,7 +1061,7 @@ The `matchPolicy` for an admission webhooks defaults to `Equivalent`.
10581061
<!--
10591062
### Contacting the webhook
10601063
-->
1061-
### 调用 Webhook
1064+
### 调用 Webhook {#contacting-the-webhook}
10621065

10631066
<!--
10641067
Once the API server has determined a request should be sent to a webhook,
@@ -1423,7 +1426,7 @@ API 服务器提供了监视准入 Webhook 行为的方法。这些监视机制
14231426
<!--
14241427
### Mutating webhook auditing annotations
14251428
-->
1426-
### Mutating Webhook 审计注解
1429+
### Mutating Webhook 审计注解 {#mutating-webhook-auditing-annotations}
14271430

14281431
<!--
14291432
Sometimes it's useful to know which mutating webhook mutated the object in a API request, and what change did the
@@ -1574,7 +1577,7 @@ The audit level of a event determines which annotations get recorded:
15741577
<!--
15751578
### Admission webhook metrics
15761579
-->
1577-
### 准入 Webhook 度量值
1580+
### 准入 Webhook 度量值 {#admission-webhook-metrics}
15781581

15791582
<!--
15801583
The API server exposes Prometheus metrics from the `/metrics` endpoint, which can be used for monitoring and
@@ -1586,7 +1589,7 @@ API 服务器从 `/metrics` 端点公开 Prometheus 指标,这些指标可用
15861589
<!--
15871590
#### API server admission webhook rejection count
15881591
-->
1589-
#### apiserver 准入 Webhook 拒绝次数
1592+
#### apiserver 准入 Webhook 拒绝次数 {#api-server-admission-webhook-rejection-count}
15901593

15911594
<!--
15921595
Sometimes it's useful to know which admission webhooks are frequently rejecting API requests, and the
@@ -1645,7 +1648,7 @@ apiserver_admission_webhook_rejection_count{error_type="no_error",name="deny-unw
16451648
16461649
### Idempotence
16471650
-->
1648-
## 最佳实践和警告
1651+
## 最佳实践和警告 {#best-practices-and-warnings}
16491652
16501653
### 幂等性 {#idempotence}
16511654
@@ -1670,7 +1673,7 @@ the initial application.
16701673
16711674
In the cases above, the webhook can be safely reinvoked, or admit an object that already has the fields set.
16721675
-->
1673-
#### 幂等 mutating admission Webhook 的示例:
1676+
#### 幂等 mutating admission Webhook 的示例: {#example-of-idempotent-mutating-admission-webhooks}
16741677
16751678
1. 对于 `CREATE` Pod 请求,将 Pod 的字段 `.spec.securityContext.runAsNonRoot`
16761679
设置为 true,以实施安全最佳实践。
@@ -1684,7 +1687,7 @@ In the cases above, the webhook can be safely reinvoked, or admit an object that
16841687
<!--
16851688
#### Example of non-idempotent mutating admission webhooks:
16861689
-->
1687-
#### 非幂等 mutating admission Webhook 的示例:
1690+
#### 非幂等 mutating admission Webhook 的示例: {#example-of-non-idempotent-mutating-admission-webhooks}
16881691
16891692
<!--
16901693
1. For a `CREATE` pod request, inject a sidecar container with name `foo-sidecar`
@@ -1731,7 +1734,7 @@ to `Equivalent`. It is also recommended that admission webhooks should prefer re
17311734
Failure to intercept all versions of an object can result in admission policies not being enforced for requests in certain
17321735
versions. See [Matching requests: matchPolicy](#matching-requests-matchpolicy) for examples.
17331736
-->
1734-
### 拦截对象的所有版本
1737+
### 拦截对象的所有版本 {#intercepting-all-versions-of-an-object}
17351738
17361739
建议通过将 `.webhooks[].matchPolicy` 设置为 `Equivalent`,
17371740
以确保准入 Webhooks 始终拦截对象的所有版本。
@@ -1768,7 +1771,7 @@ For example, a mutating admission webhook is configured to inject a sidecar cont
17681771
that a container with name "foo-sidecar" with the expected configuration exists in the to-be-created object.
17691772
-->
17701773
1771-
### 确保看到对象的最终状态
1774+
### 确保看到对象的最终状态 {#guaranteeing-the-final-state-of-the-object-is-seen}
17721775
17731776
如果某准入 Webhook 需要保证自己能够看到对象的最终状态以实施策略,
17741777
则应该使用一个验证性质的 webhook,
@@ -1795,7 +1798,7 @@ get rejected by the existing webhook server since the `"env"` label is unset, an
17951798
17961799
It is recommended to exclude the namespace where your webhook is running with a [namespaceSelector](#matching-requests-namespaceselector).
17971800
-->
1798-
### 避免自托管的 Webhooks 中出现死锁
1801+
### 避免自托管的 Webhooks 中出现死锁 {#avoiding-deadlocks-in-self-hosted-webhooks}
17991802
18001803
如果集群内的 Webhook 配置能够拦截启动其自己的 Pod 所需的资源,
18011804
则该 Webhook 可能导致其自身部署时发生死锁。
@@ -1834,7 +1837,7 @@ set to `NoneOnDryRun`. See [Side effects](#side-effects) for more detail.
18341837
<!--
18351838
### Avoiding operating on the kube-system namespace
18361839
-->
1837-
### 避免对 kube-system 名字空间进行操作
1840+
### 避免对 kube-system 名字空间进行操作 {#avoiding-operating-on-the-kube-system-namespace}
18381841
18391842
<!--
18401843
The `kube-system` namespace contains objects created by the Kubernetes system,

0 commit comments

Comments
 (0)