@@ -4,7 +4,6 @@ linkTitle: 准入控制器
4
4
content_type : concept
5
5
weight : 30
6
6
---
7
-
8
7
<!--
9
8
reviewers:
10
9
- lavalamp
@@ -342,7 +341,8 @@ This admission controller ignores any `PersistentVolumeClaim` updates; it acts o
342
341
See [persistent volume](/docs/concepts/storage/persistent-volumes/) documentation about persistent volume claims and
343
342
storage classes and how to mark a storage class as default.
344
343
-->
345
- 关于持久卷申领和存储类,以及如何将存储类标记为默认,请参见[ 持久卷] ( /zh-cn/docs/concepts/storage/persistent-volumes/ ) 页面。
344
+ 关于持久卷申领和存储类,以及如何将存储类标记为默认,
345
+ 请参见[ 持久卷] ( /zh-cn/docs/concepts/storage/persistent-volumes/ ) 页面。
346
346
347
347
### DefaultTolerationSeconds {#defaulttolerationseconds}
348
348
@@ -505,6 +505,20 @@ This file may be json or yaml and has the following format:
505
505
ImagePolicyWebhook 使用配置文件来为后端行为设置选项。该文件可以是 JSON 或 YAML,
506
506
并具有以下格式:
507
507
508
+ <!--
509
+ ` ` ` yaml
510
+ imagePolicy :
511
+ kubeConfigFile : /path/to/kubeconfig/for/backend
512
+ # time in s to cache approval
513
+ allowTTL : 50
514
+ # time in s to cache denial
515
+ denyTTL : 50
516
+ # time in ms to wait between retries
517
+ retryBackoff : 500
518
+ # determines behavior if the webhook backend fails
519
+ defaultAllow : true
520
+ ` ` `
521
+ -->
508
522
` ` ` yaml
509
523
imagePolicy :
510
524
kubeConfigFile : /path/to/kubeconfig/for/backend
@@ -635,15 +649,14 @@ group (`--runtime-config=imagepolicy.k8s.io/v1alpha1=true`).
635
649
-->
636
650
注意,Webhook API 对象与其他 Kubernetes API 对象一样受制于相同的版本控制兼容性规则。
637
651
实现者应该知道对 alpha 对象兼容性是相对宽松的,并检查请求的 "apiVersion" 字段,
638
- 以确保正确的反序列化。
639
- 此外,API 服务器必须启用 `imagepolicy.k8s.io/v1alpha1` API 扩展组
652
+ 以确保正确的反序列化。此外,API 服务器必须启用 `imagepolicy.k8s.io/v1alpha1` API 扩展组
640
653
(`--runtime-config=imagepolicy.k8s.io/v1alpha1=true`)。
641
654
{{< /note >}}
642
655
643
656
<!--
644
657
An example request body :
645
658
-->
646
- 请求载荷示例 :
659
+ 请求体示例 :
647
660
648
661
` ` ` json
649
662
{
@@ -808,7 +821,7 @@ group/version via the `--runtime-config` flag, both are on by default.
808
821
<!--
809
822
# ### Use caution when authoring and installing mutating webhooks
810
823
-->
811
- # ### 谨慎编写和安装变更 webhook {#use-caution-when-authoring-and-installing-mutating-webhooks}
824
+ # ### 谨慎编写和安装变更 Webhook {#use-caution-when-authoring-and-installing-mutating-webhooks}
812
825
813
826
<!--
814
827
* Users may be confused when the objects they try to create are different from
@@ -860,8 +873,7 @@ This admission controller also prevents deletion of three system reserved namesp
860
873
` kube-system` , `kube-public`.
861
874
-->
862
875
该准入控制器禁止在一个正在被终止的 `Namespace` 中创建新对象,并确保针对不存在的
863
- ` Namespace` 的请求被拒绝。
864
- 该准入控制器还会禁止删除三个系统保留的名字空间,即 `default`、
876
+ ` Namespace` 的请求被拒绝。该准入控制器还会禁止删除三个系统保留的名字空间,即 `default`、
865
877
` kube-system` 和 `kube-public`。
866
878
867
879
<!--
@@ -1006,8 +1018,7 @@ This admission controller is disabled by default.
1006
1018
此准入控制器会自动将由云提供商(如 Azure 或 GCP)定义的区(region)或区域(zone)
1007
1019
标签附加到 PersistentVolume 上。这有助于确保 Pod 和 PersistentVolume 位于相同的区或区域。
1008
1020
如果准入控制器不支持为 PersistentVolumes 自动添加标签,那你可能需要手动添加标签,
1009
- 以防止 Pod 挂载其他区域的卷。
1010
- PersistentVolumeLabel **已被弃用**,
1021
+ 以防止 Pod 挂载其他区域的卷。PersistentVolumeLabel **已被弃用**,
1011
1022
为持久卷添加标签的操作已由{{< glossary_tooltip text="云管理控制器" term_id="cloud-controller-manager" >}}接管。
1012
1023
1013
1024
此准入控制器默认被禁用。
@@ -1129,7 +1140,7 @@ admitted, determines if it should be admitted based on the requested security co
1129
1140
for the namespace that the Pod would be in.
1130
1141
-->
1131
1142
PodSecurity 准入控制器在新 Pod 被准入之前对其进行检查,
1132
- 根据请求的安全上下文和 Pod 所在命名空间允许的
1143
+ 根据请求的安全上下文和 Pod 所在名字空间允许的
1133
1144
[Pod 安全性标准](/zh/docs/concepts/security/pod-security-standards/)的限制来确定新 Pod
1134
1145
是否应该被准入。
1135
1146
@@ -1253,21 +1264,34 @@ for more information.
1253
1264
1254
1265
# ## SecurityContextDeny {#securitycontextdeny}
1255
1266
1256
- {{< feature-state for_k8s_version="v1.0 " state="alpha " >}}
1267
+ {{< feature-state for_k8s_version="v1.27 " state="deprecated " >}}
1257
1268
1258
1269
{{< caution >}}
1259
1270
<!--
1260
- This admission controller plugin is **outdated** and **incomplete**, it may be
1261
- unusable or not do what you would expect. It was originally designed to prevent
1262
- the use of some, but not all, security-sensitive fields. Indeed, fields like
1263
- ` privileged` , were not filtered at creation and the plugin was not updated with
1264
- the most recent fields, and new APIs like the `ephemeralContainers` field for a
1265
- Pod.
1271
+ The Kubernetes project recommends that you **do not use** the
1272
+ ` SecurityContextDeny` admission controller.
1273
+
1274
+ The `SecurityContextDeny` admission controller plugin is deprecated and disabled
1275
+ by default. It will be removed in a future version. If you choose to enable the
1276
+ ` SecurityContextDeny` admission controller plugin, you must enable the
1277
+ ` SecurityContextDeny` feature gate as well.
1278
+ -->
1279
+ Kubernetes 项目建议你**不要使用** `SecurityContextDeny` 准入控制器。
1280
+
1281
+ ` SecurityContextDeny` 准入控制器插件已被弃用,并且默认处于禁用状态。
1282
+ 此插件将在后续的版本中被移除。如果你选择启用 `SecurityContextDeny` 准入控制器插件,
1283
+ 也必须同时启用 `SecurityContextDeny` 特性门控。
1284
+
1285
+ <!--
1286
+ The `SecurityContextDeny` admission plugin is deprecated because it is outdated
1287
+ and incomplete; it may be unusable or not do what you would expect. As
1288
+ implemented, this plugin is unable to restrict all security-sensitive attributes
1289
+ of the Pod API. For example, the `privileged` and `ephemeralContainers` fields
1290
+ were never restricted by this plugin.
1266
1291
-->
1267
- 这个准入控制器插件是**过时的**且**不完整的**,它可能无法使用或无法达到你的预期。
1268
- 它最初旨在防止使用某些(但不是全部)安全敏感字段。
1269
- 事实上,像 `privileged` 这样的字段在创建时并没有被过滤,
1270
- 而且该插件没有根据最新的字段和新的 API(例如 Pod 的 `ephemeralContainers` 字段)来更新。
1292
+ ` SecurityContextDeny` 准入插件已被弃用,因为它已经过时且不完整;
1293
+ 它可能无法使用或无法达到你的预期。该插件实现之时,就无法限制 Pod API 的所有与安全相关的属性。
1294
+ 例如,`privileged` 和 `ephemeralContainers` 字段就从未受过此插件的限制。
1271
1295
1272
1296
<!--
1273
1297
The [Pod Security Admission](/docs/concepts/security/pod-security-admission/)
@@ -1333,8 +1357,8 @@ Refer to the
1333
1357
for more detailed information.
1334
1358
-->
1335
1359
` StorageObjectInUseProtection` 插件将 `kubernetes.io/pvc-protection` 或
1336
- ` kubernetes.io/pv-protection` finalizers 添加到新创建的持久卷申领(PVC)
1337
- 或持久卷(PV)中。如果用户尝试删除 PVC/PV,除非 PVC/PV 的保护控制器移除终结器(finalizers) ,
1360
+ ` kubernetes.io/pv-protection` 终结器( finalizers) 添加到新创建的持久卷申领(PVC)
1361
+ 或持久卷(PV)中。如果用户尝试删除 PVC/PV,除非 PVC/PV 的保护控制器移除终结器,
1338
1362
否则 PVC/PV 不会被删除。有关更多详细信息,
1339
1363
请参考[保护使用中的存储对象](/zh-cn/docs/concepts/storage/persistent-volumes/#storage-object-in-use-protection)。
1340
1364
@@ -1406,4 +1430,3 @@ You can enable additional admission controllers beyond the default set using the
1406
1430
(请查看[这里](/zh-cn/docs/reference/command-line-tools-reference/kube-apiserver/#options))。
1407
1431
因此,你无需显式指定它们。
1408
1432
你可以使用 `--enable-admission-plugins` 标志( **顺序不重要** )来启用默认设置以外的其他准入控制器。
1409
-
0 commit comments