Skip to content

Commit f1ce25b

Browse files
authored
Merge pull request #48980 from windsonsea/admller
[zh] Sync admission-controllers.md
2 parents f1ddfbf + 0f4a930 commit f1ce25b

File tree

1 file changed

+72
-57
lines changed

1 file changed

+72
-57
lines changed

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

Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 准入控制器参考
3-
linkTitle: 准入控制器
2+
title: Kubernetes 中的准入控制
3+
linkTitle: 准入控制
44
content_type: concept
55
weight: 40
66
---
@@ -12,17 +12,32 @@ reviewers:
1212
- erictune
1313
- janetkuo
1414
- thockin
15-
title: Admission Controllers Reference
16-
linkTitle: Admission Controllers
15+
title: Admission Control in Kubernetes
16+
linkTitle: Admission Control
1717
content_type: concept
1818
weight: 40
1919
-->
2020

2121
<!-- overview -->
2222
<!--
23-
This page provides an overview of Admission Controllers.
23+
This page provides an overview of _admission controllers_.
2424
-->
25-
此页面提供准入控制器(Admission Controller)的概述。
25+
此页面提供**准入控制器(Admission Controller)** 的概述。
26+
27+
<!--
28+
An admission controller is a piece of code that intercepts requests to the
29+
Kubernetes API server prior to persistence of the resource, but after the request
30+
is authenticated and authorized.
31+
32+
Several important features of Kubernetes require an admission controller to be enabled in order
33+
to properly support the feature. As a result, a Kubernetes API server that is not properly
34+
configured with the right set of admission controllers is an incomplete server that will not
35+
support all the features you expect.
36+
-->
37+
准入控制器是一段代码,它会在请求通过认证和鉴权之后、对象被持久化之前拦截到达 API 服务器的请求。
38+
39+
Kubernetes 的若干重要功能都要求启用一个准入控制器,以便正确地支持该特性。
40+
因此,没有正确配置准入控制器的 Kubernetes API 服务器是不完整的,它无法支持你所期望的所有特性。
2641

2742
<!-- body -->
2843

@@ -32,44 +47,70 @@ This page provides an overview of Admission Controllers.
3247
## 什么是准入控制插件? {#what-are-they}
3348

3449
<!--
35-
An _admission controller_ is a piece of code that intercepts requests to the
36-
Kubernetes API server prior to persistence of the object, but after the request
37-
is authenticated and authorized.
38-
39-
Admission controllers may be _validating_, _mutating_, or both. Mutating
40-
controllers may modify objects related to the requests they admit; validating controllers may not.
50+
Admission controllers are code within the Kubernetes
51+
{{< glossary_tooltip term_id="kube-apiserver" text="API server" >}} that check the
52+
data arriving in a request to modify a resource.
4153
42-
Admission controllers limit requests to create, delete, modify objects. Admission
43-
controllers can also block custom verbs, such as a request connect to a Pod via
44-
an API server proxy. Admission controllers do _not_ (and cannot) block requests
45-
to read (**get**, **watch** or **list**) objects.
54+
Admission controllers apply to requests that create, delete, or modify objects.
55+
Admission controllers can also block custom verbs, such as a request to connect to a
56+
pod via an API server proxy. Admission controllers do _not_ (and cannot) block requests
57+
to read (**get**, **watch** or **list**) objects, because reads bypass the admission
58+
control layer.
4659
-->
47-
**准入控制器** 是一段代码,它会在请求通过认证和鉴权之后、对象被持久化之前拦截到达 API
48-
服务器的请求。
49-
50-
准入控制器可以执行**验证(Validating)** 和/或**变更(Mutating)** 操作。
51-
变更(mutating)控制器可以根据被其接受的请求更改相关对象;验证(validating)控制器则不行。
60+
准入控制器是 Kubernetes
61+
{{< glossary_tooltip term_id="kube-apiserver" text="API 服务器" >}}中的代码,
62+
用于检查请求中到达的数据,以修改资源。
5263

53-
准入控制器限制创建、删除、修改对象的请求
64+
准入控制器适用于创建、删除或修改对象的请求
5465
准入控制器也可以阻止自定义动作,例如通过 API 服务器代理连接到 Pod 的请求。
55-
准入控制器**不会** (也不能)阻止读取(**get****watch****list**)对象的请求。
66+
准入控制器**不会**(也不能)阻止读取(**get****watch****list**)对象的请求,
67+
这是因为读取操作会绕过准入控制层。
5668

5769
<!--
70+
Admission control mechanisms may be _validating_, _mutating_, or both. Mutating
71+
controllers may modify the data for the resource being modified; validating controllers may not.
72+
5873
The admission controllers in Kubernetes {{< skew currentVersion >}} consist of the
5974
[list](#what-does-each-admission-controller-do) below, are compiled into the
6075
`kube-apiserver` binary, and may only be configured by the cluster
61-
administrator. In that list, there are two special controllers:
62-
MutatingAdmissionWebhook and ValidatingAdmissionWebhook. These execute the
63-
mutating and validating (respectively)
64-
[admission control webhooks](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)
65-
which are configured in the API.
76+
administrator.
6677
-->
78+
准入控制器机制可以执行**验证(Validating)** 和/或**变更(Mutating)** 操作。
79+
变更(Mutating)控制器可以为正在修改的资源修改数据;验证(Validating)控制器则不行。
80+
6781
Kubernetes {{< skew currentVersion >}}
6882
中的准入控制器由下面的[列表](#what-does-each-admission-controller-do)组成,
6983
并编译进 `kube-apiserver` 可执行文件,并且只能由集群管理员配置。
70-
在该列表中,有两个特殊的控制器:MutatingAdmissionWebhook 和 ValidatingAdmissionWebhook。
71-
它们根据 API 中的配置,
72-
分别执行变更和验证[准入控制 Webhook](/zh-cn/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)
84+
85+
<!--
86+
### Admission control extension points
87+
88+
Within the full [list](#what-does-each-admission-controller-do), there are three
89+
special controllers:
90+
[MutatingAdmissionWebhook](#mutatingadmissionwebhook),
91+
[ValidatingAdmissionWebhook](#validatingadmissionwebhook), and
92+
[ValidatingAdmissionPolicy](#validatingadmissionpolicy).
93+
The two webhook controllers execute the mutating and validating (respectively)
94+
[admission control webhooks](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)
95+
which are configured in the API. ValidatingAdmissionPolicy provides a way to embed
96+
declarative validation code within the API, without relying on any external HTTP
97+
callouts.
98+
-->
99+
### 准入控制扩展点 {#admission-control-extension-points}
100+
101+
在完整的[列表](#what-does-each-admission-controller-do)中,有三个特殊的控制器:
102+
[MutatingAdmissionWebhook](#mutatingadmissionwebhook)
103+
[ValidatingAdmissionWebhook](#validatingadmissionwebhook)
104+
[ValidatingAdmissionPolicy](#validatingadmissionpolicy)
105+
前两个 Webhook 控制器分别执行在 API
106+
中所配置的变更和验证[准入控制 Webhook](/zh-cn/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks)
107+
而 ValidatingAdmissionPolicy 提供了一种在 API 中嵌入声明式验证代码的方式,无需依赖任何外部 HTTP 调用。
108+
109+
<!--
110+
You can use these three admission controllers to customize cluster behavior at
111+
admission time.
112+
-->
113+
你可以使用这三个准入控制器来定制准入时的集群行为。
73114

74115
<!--
75116
## Admission control phases
@@ -102,19 +143,6 @@ other admission controllers.
102143
增加配额用量就是一个典型的示例,说明了这样做的必要性。
103144
此类用法都需要相应的回收或回调过程,因为任一准入控制器都无法确定某个请求能否通过所有其它准入控制器。
104145

105-
<!--
106-
## Why do I need them?
107-
108-
Several important features of Kubernetes require an admission controller to be enabled in order
109-
to properly support the feature. As a result, a Kubernetes API server that is not properly
110-
configured with the right set of admission controllers is an incomplete server and will not
111-
support all the features you expect.
112-
-->
113-
## 为什么需要准入控制器? {#why-do-i-need-them}
114-
115-
Kubernetes 的若干重要功能都要求启用一个准入控制器,以便正确地支持该特性。
116-
因此,没有正确配置准入控制器的 Kubernetes API 服务器是不完整的,它无法支持你所期望的所有特性。
117-
118146
<!--
119147
## How do I turn on an admission controller?
120148
@@ -182,19 +210,6 @@ In Kubernetes {{< skew currentVersion >}}, the default ones are:
182210
CertificateApproval, CertificateSigning, CertificateSubjectRestriction, DefaultIngressClass, DefaultStorageClass, DefaultTolerationSeconds, LimitRanger, MutatingAdmissionWebhook, NamespaceLifecycle, PersistentVolumeClaimResize, PodSecurity, Priority, ResourceQuota, RuntimeClass, ServiceAccount, StorageObjectInUseProtection, TaintNodesByCondition, ValidatingAdmissionPolicy, ValidatingAdmissionWebhook
183211
```
184212

185-
{{< note >}}
186-
<!--
187-
The [`ValidatingAdmissionPolicy`](#validatingadmissionpolicy) admission plugin is enabled
188-
by default, but is only active if you enable the `ValidatingAdmissionPolicy`
189-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) **and**
190-
the `admissionregistration.k8s.io/v1alpha1` API.
191-
-->
192-
[`ValidatingAdmissionPolicy`](#validatingadmissionpolicy) 准入插件默认被启用,
193-
但只有启用 `ValidatingAdmissionPolicy`
194-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) ****
195-
`admissionregistration.k8s.io/v1alpha1` API 时才会激活。
196-
{{< /note >}}
197-
198213
<!--
199214
## What does each admission controller do?
200215
-->

0 commit comments

Comments
 (0)