Skip to content

Commit e2e4f89

Browse files
authored
Merge pull request #36070 from windsonsea/admcon
[zh-cn] resync /access-authn-authz/admission-controllers.md
2 parents dd20372 + bf725f7 commit e2e4f89

File tree

1 file changed

+77
-104
lines changed

1 file changed

+77
-104
lines changed

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

Lines changed: 77 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ CertificateApproval, CertificateSigning, CertificateSubjectRestriction, DefaultI
177177
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
178178

179179
<!--
180-
This admission controller allows all pods into the cluster. It is deprecated because its behavior is the same as if there were no admission controller at all.
180+
This admission controller allows all pods into the cluster. It is deprecated because
181+
its behavior is the same as if there were no admission controller at all.
181182
-->
182183
该准入控制器允许所有的 Pod 进入集群。此插件已被弃用,因其行为与没有准入控制器一样。
183184

@@ -332,55 +333,6 @@ The default value for `default-not-ready-toleration-seconds` and `default-unreac
332333
`default-not-ready-toleration-seconds``default-unreachable-toleration-seconds`
333334
的默认值是 5 分钟。
334335

335-
### DenyEscalatingExec {#denyescalatingexec}
336-
337-
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
338-
339-
<!--
340-
This admission controller will deny exec and attach commands to pods that run with escalated privileges that
341-
allow host access. This includes pods that run as privileged, have access to the host IPC namespace, and
342-
have access to the host PID namespace.
343-
-->
344-
此准入控制器将拒绝在由于拥有提级特权而具备访问宿主机能力的 Pod 中执行 exec 和
345-
attach 命令。这类 Pod 包括在特权模式运行的 Pod、可以访问主机 IPC 名字空间的 Pod、
346-
和访问主机 PID 名字空间的 Pod。
347-
348-
<!--
349-
The DenyEscalatingExec admission plugin is deprecated.
350-
351-
Use of a policy-based admission plugin (like [PodSecurityPolicy](#podsecuritypolicy) or a custom admission plugin)
352-
which can be targeted at specific users or Namespaces and also protects against creation of overly privileged Pods
353-
is recommended instead.
354-
-->
355-
DenyEscalatingExec 准入插件已被弃用。
356-
357-
建议使用基于策略的准入插件(例如 [PodSecurityPolicy](#podsecuritypolicy) 和自定义准入插件),
358-
这类插件可以针对特定用户或名字空间,还可以防止创建权限过高的 Pod。
359-
360-
### DenyExecOnPrivileged {#denyexeconprivileged}
361-
362-
{{< feature-state for_k8s_version="v1.13" state="deprecated" >}}
363-
364-
<!--
365-
This admission controller will intercept all requests to exec a command in a pod if that pod has a privileged container.
366-
-->
367-
如果一个 Pod 中存在特权容器,该准入控制器将拦截所有在该 Pod 中执行 exec 命令的请求。
368-
369-
<!--
370-
This functionality has been merged into [DenyEscalatingExec](#denyescalatingexec).
371-
The DenyExecOnPrivileged admission plugin is deprecated.
372-
-->
373-
此功能已合并至 [DenyEscalatingExec](#denyescalatingexec)
374-
而 DenyExecOnPrivileged 准入插件已被弃用。
375-
376-
<!--
377-
Use of a policy-based admission plugin (like [PodSecurityPolicy](#podsecuritypolicy) or a custom admission plugin)
378-
which can be targeted at specific users or Namespaces and also protects against creation of overly privileged Pods
379-
is recommended instead.
380-
-->
381-
建议使用基于策略的准入插件(例如 [PodSecurityPolicy](#podsecuritypolicy) 和自定义准入插件),
382-
这类插件可以针对特定用户或名字空间,还可以防止创建权限过高的 Pod。
383-
384336
### DenyServiceExternalIPs {#denyserviceexternalips}
385337

386338
<!--
@@ -406,7 +358,7 @@ of it.
406358
大多数用户根本不需要此特性,集群管理员应考虑将其禁用。
407359
确实需要使用此特性的集群应考虑使用一些自定义策略来管理 `externalIPs` 的使用。
408360

409-
### EventRateLimit {#eventratelimit}
361+
### EventRateLimit {#eventratelimit}
410362

411363
{{< feature-state for_k8s_version="v1.13" state="alpha" >}}
412364

@@ -425,14 +377,14 @@ event requests. The cluster admin can specify event rate limits by:
425377
* 在通过 API 服务器的命令行标志 `--admission-control-config-file` 设置的文件中,
426378
引用 `EventRateLimit` 配置文件:
427379

428-
```yaml
429-
apiVersion: apiserver.config.k8s.io/v1
430-
kind: AdmissionConfiguration
431-
plugins:
432-
- name: EventRateLimit
433-
path: eventconfig.yaml
434-
...
435-
```
380+
```yaml
381+
apiVersion: apiserver.config.k8s.io/v1
382+
kind: AdmissionConfiguration
383+
plugins:
384+
- name: EventRateLimit
385+
path: eventconfig.yaml
386+
...
387+
```
436388

437389
<!--
438390
There are four types of limits that can be specified in the configuration:
@@ -472,10 +424,14 @@ limits:
472424
<!--
473425
See the [EventRateLimit Config API (v1alpha1)](/docs/reference/config-api/apiserver-eventratelimit.v1alpha1/)
474426
for more details.
427+
428+
This admission controller is disabled by default.
475429
-->
476430
详情请参见
477431
[EventRateLimit 配置 API 文档(v1alpha1)](/zh-cn/docs/reference/config-api/apiserver-eventratelimit.v1alpha1/)。
478432
433+
此准入控制器默认被禁用。
434+
479435
### ExtendedResourceToleration {#extendedresourcetoleration}
480436
481437
<!--
@@ -485,20 +441,28 @@ If operators want to create dedicated nodes with extended resources (like GPUs,
485441
name as the key. This admission controller, if enabled, automatically
486442
adds tolerations for such taints to pods requesting extended resources, so users don't have to manually
487443
add these tolerations.
444+
445+
This admission controller is diabled by default.
488446
-->
489447
此插件有助于创建带有扩展资源的专用节点。
490448
如果运维人员想要创建带有扩展资源(如 GPU、FPGA 等)的专用节点,他们应该以扩展资源名称作为键名,
491449
[为节点设置污点](/zh-cn/docs/concepts/scheduling-eviction/taint-and-toleration/)。
492450
如果启用了此准入控制器,会将此类污点的容忍度自动添加到请求扩展资源的 Pod 中,
493451
用户不必再手动添加这些容忍度。
494452
453+
此准入控制器默认被禁用。
454+
495455
### ImagePolicyWebhook {#imagepolicywebhook}
496456
497457
<!--
498458
The ImagePolicyWebhook admission controller allows a backend webhook to make admission decisions.
459+
460+
This admission controller is disabled by default.
499461
-->
500462
ImagePolicyWebhook 准入控制器允许使用后端 Webhook 做出准入决策。
501463
464+
此准入控制器默认被禁用。
465+
502466
<!--
503467
#### Configuration File Format
504468
@@ -533,8 +497,8 @@ Reference the ImagePolicyWebhook configuration file from the file provided to th
533497
apiVersion: apiserver.config.k8s.io/v1
534498
kind: AdmissionConfiguration
535499
plugins:
536-
- name: ImagePolicyWebhook
537-
path: imagepolicyconfig.yaml
500+
- name: ImagePolicyWebhook
501+
path: imagepolicyconfig.yaml
538502
...
539503
```
540504

@@ -547,14 +511,14 @@ Alternatively, you can embed the configuration directly in the file:
547511
apiVersion: apiserver.config.k8s.io/v1
548512
kind: AdmissionConfiguration
549513
plugins:
550-
- name: ImagePolicyWebhook
551-
configuration:
552-
imagePolicy:
553-
kubeConfigFile: <kubeconfig 文件路径>
554-
allowTTL: 50
555-
denyTTL: 50
556-
retryBackoff: 500
557-
defaultAllow: true
514+
- name: ImagePolicyWebhook
515+
configuration:
516+
imagePolicy:
517+
kubeConfigFile: <kubeconfig 文件路径>
518+
allowTTL: 50
519+
denyTTL: 50
520+
retryBackoff: 500
521+
defaultAllow: true
558522
```
559523

560524
<!--
@@ -577,34 +541,34 @@ kubeconfig 文件的 `clusters` 字段需要指向远端服务,`users` 字段
577541
```yaml
578542
# clusters refers to the remote service.
579543
clusters:
580-
- name: name-of-remote-imagepolicy-service
581-
cluster:
582-
certificate-authority: /path/to/ca.pem # CA for verifying the remote service.
583-
server: https://images.example.com/policy # URL of remote service to query. Must use 'https'.
544+
- name: name-of-remote-imagepolicy-service
545+
cluster:
546+
certificate-authority: /path/to/ca.pem # CA for verifying the remote service.
547+
server: https://images.example.com/policy # URL of remote service to query. Must use 'https'.
584548
585549
# users refers to the API server's webhook configuration.
586550
users:
587-
- name: name-of-api-server
588-
user:
589-
client-certificate: /path/to/cert.pem # cert for the webhook admission controller to use
590-
client-key: /path/to/key.pem # key matching the cert
551+
- name: name-of-api-server
552+
user:
553+
client-certificate: /path/to/cert.pem # cert for the webhook admission controller to use
554+
client-key: /path/to/key.pem # key matching the cert
591555
```
592556
-->
593557

594558
```yaml
595559
# clusters 指的是远程服务。
596560
clusters:
597-
- name: name-of-remote-imagepolicy-service
598-
cluster:
599-
certificate-authority: /path/to/ca.pem # CA 用于验证远程服务
600-
server: https://images.example.com/policy # 要查询的远程服务的 URL,必须是 'https'。
561+
- name: name-of-remote-imagepolicy-service
562+
cluster:
563+
certificate-authority: /path/to/ca.pem # CA 用于验证远程服务
564+
server: https://images.example.com/policy # 要查询的远程服务的 URL,必须是 'https'。
601565
602566
# users 指的是 API 服务器的 Webhook 配置。
603567
users:
604-
- name: name-of-api-server
605-
user:
606-
client-certificate: /path/to/cert.pem # Webhook 准入控制器使用的证书
607-
client-key: /path/to/key.pem # 证书匹配的密钥
568+
- name: name-of-api-server
569+
user:
570+
client-certificate: /path/to/cert.pem # Webhook 准入控制器使用的证书
571+
client-key: /path/to/key.pem # 证书匹配的密钥
608572
```
609573

610574
<!--
@@ -748,10 +712,14 @@ In any case, the annotations are provided by the user and are not validated by K
748712
<!--
749713
This admission controller denies any pod that defines `AntiAffinity` topology key other than
750714
`kubernetes.io/hostname` in `requiredDuringSchedulingRequiredDuringExecution`.
715+
716+
This admission controller is disabled by default.
751717
-->
752718
此准入控制器拒绝定义了 `AntiAffinity` 拓扑键的任何 Pod
753719
(`requiredDuringSchedulingRequiredDuringExecution` 中的 `kubernetes.io/hostname` 除外)。
754720

721+
此准入控制器默认被禁用。
722+
755723
### LimitRanger {#limitranger}
756724

757725
<!--
@@ -1001,15 +969,17 @@ If the admission controller doesn't support automatic labelling your PersistentV
1001969
may need to add the labels manually to prevent pods from mounting volumes from
1002970
a different zone. PersistentVolumeLabel is DEPRECATED and labeling persistent volumes has been taken over by
1003971
the {{< glossary_tooltip text="cloud-controller-manager" term_id="cloud-controller-manager" >}}.
1004-
Starting from 1.11, this admission controller is disabled by default.
972+
973+
This admission controller is disabled by default.
1005974
-->
1006975
此准入控制器会自动将由云提供商(如 GCE、AWS)定义的区(region)或区域(zone)
1007976
标签附加到 PersistentVolume 上。这有助于确保 Pod 和 PersistentVolume 位于相同的区或区域。
1008977
如果准入控制器不支持为 PersistentVolumes 自动添加标签,那你可能需要手动添加标签,
1009978
以防止 Pod 挂载其他区域的卷。
1010-
PersistentVolumeLabel 已被弃用,为持久卷添加标签的操作已由
1011-
{{< glossary_tooltip text="云管理控制器" term_id="cloud-controller-manager" >}}接管。
1012-
从 1.11 开始,默认情况下禁用此准入控制器。
979+
PersistentVolumeLabel 已被弃用,
980+
为持久卷添加标签的操作已由{{< glossary_tooltip text="云管理控制器" term_id="cloud-controller-manager" >}}接管。
981+
982+
此准入控制器默认被禁用。
1013983

1014984
### PodNodeSelector {#podnodeselector}
1015985

@@ -1018,9 +988,13 @@ PersistentVolumeLabel 已被弃用,为持久卷添加标签的操作已由
1018988
<!--
1019989
This admission controller defaults and limits what node selectors may be used within a namespace
1020990
by reading a namespace annotation and a global configuration.
991+
992+
This admission controller is disabled by default.
1021993
-->
1022994
此准入控制器通过读取名字空间注解和全局配置,来为名字空间中可以使用的节点选择器设置默认值并实施限制。
1023995

996+
此准入控制器默认被禁用。
997+
1024998
<!--
1025999
#### Configuration file format
10261000

@@ -1036,9 +1010,9 @@ This file may be json or yaml and has the following format:
10361010

10371011
```yaml
10381012
podNodeSelectorPluginConfig:
1039-
clusterDefaultNodeSelector: name-of-node-selector
1040-
namespace1: name-of-node-selector
1041-
namespace2: name-of-node-selector
1013+
clusterDefaultNodeSelector: name-of-node-selector
1014+
namespace1: name-of-node-selector
1015+
namespace2: name-of-node-selector
10421016
```
10431017

10441018
<!--
@@ -1052,8 +1026,8 @@ command line flag `--admission-control-config-file`:
10521026
apiVersion: apiserver.config.k8s.io/v1
10531027
kind: AdmissionConfiguration
10541028
plugins:
1055-
- name: PodNodeSelector
1056-
path: podnodeselector.yaml
1029+
- name: PodNodeSelector
1030+
path: podnodeselector.yaml
10571031
...
10581032
```
10591033

@@ -1198,6 +1172,11 @@ metadata:
11981172
scheduler.alpha.kubernetes.io/tolerationsWhitelist: '[{"operator": "Exists", "effect": "NoSchedule", "key": "dedicated-node"}]'
11991173
```
12001174

1175+
<!--
1176+
This admission controller is disabled by default.
1177+
-->
1178+
此准入控制器默认被禁用。
1179+
12011180
<!--
12021181
### Priority {#priority}
12031182

@@ -1232,8 +1211,6 @@ and the [example of Resource Quota](/docs/concepts/policy/resource-quotas/) for
12321211

12331212
### RuntimeClass {#runtimeclass}
12341213

1235-
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
1236-
12371214
<!--
12381215
If you define a RuntimeClass with [Pod overhead](/docs/concepts/scheduling-eviction/pod-overhead/)
12391216
configured, this admission controller checks incoming Pods.
@@ -1278,7 +1255,7 @@ then you could use this admission controller to restrict the set of values a sec
12781255
See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for more context on restricting
12791256
pod privileges.
12801257
-->
1281-
有关限制 Pod 权限的更多内容,请参阅
1258+
有关限制 Pod 权限的更多内容,请参阅
12821259
[Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards/)。
12831260

12841261
### ServiceAccount {#serviceaccount}
@@ -1313,8 +1290,6 @@ for more detailed information.
13131290

13141291
### TaintNodesByCondition {#taintnodesbycondition}
13151292

1316-
{{< feature-state for_k8s_version="v1.17" state="stable" >}}
1317-
13181293
<!--
13191294
This admission controller {{< glossary_tooltip text="taints" term_id="taint" >}} newly created
13201295
Nodes as `NotReady` and `NoSchedule`. That tainting avoids a race condition that could cause Pods
@@ -1325,7 +1300,7 @@ conditions.
13251300
这些污点能够避免一些竞态条件的发生,而这类竞态条件可能导致 Pod
13261301
在更新节点污点以准确反映其所报告状况之前,就被调度到新节点上。
13271302

1328-
### ValidatingAdmissionWebhook {#validatingadmissionwebhook}
1303+
### ValidatingAdmissionWebhook {#validatingadmissionwebhook}
13291304

13301305
<!--
13311306
This admission controller calls any validating webhooks which match the request. Matching
@@ -1349,12 +1324,10 @@ webhooks or other validating admission controllers will permit the request to fi
13491324
<!--
13501325
If you disable the ValidatingAdmissionWebhook, you must also disable the
13511326
`ValidatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1`
1352-
group/version via the `--runtime-config` flag (both are on by default in
1353-
versions 1.9 and later).
1327+
group/version via the `--runtime-config` flag.
13541328
-->
13551329
如果你禁用了 ValidatingAdmissionWebhook,还必须通过 `--runtime-config` 标志来禁用
1356-
`admissionregistration.k8s.io/v1` 组/版本中的 `ValidatingWebhookConfiguration`
1357-
对象(默认情况下在 v1.9 和更高版本中均处于启用状态)。
1330+
`admissionregistration.k8s.io/v1` 组/版本中的 `ValidatingWebhookConfiguration` 对象。
13581331

13591332
<!--
13601333
## Is there a recommended set of admission controllers to use?

0 commit comments

Comments
 (0)