@@ -65,7 +65,7 @@ seccomp 配置文件应用到你的 Pod 和容器。
65
65
In order to complete all steps in this tutorial, you must install
66
66
[kind](/docs/tasks/tools/#kind) and [kubectl](/docs/tasks/tools/#kubectl).
67
67
68
- This tutorial shows some examples that are still alpha (since v1.22 ) and
68
+ This tutorial shows some examples that are still beta (since v1.25 ) and
69
69
others that use only generally available seccomp functionality. You should
70
70
make sure that your cluster is
71
71
[configured correctly](https://kind.sigs.k8s.io/docs/user/quick-start/#setting-kubernetes-version)
@@ -77,7 +77,7 @@ You can adapt the steps to use a different tool if you prefer.
77
77
为了完成本篇教程中的所有步骤,你必须安装 [ kind] ( /zh-cn/docs/tasks/tools/#kind )
78
78
和 [ kubectl] ( /zh-cn/docs/tasks/tools/#kubectl ) 。
79
79
80
- 本篇教程演示的某些示例仍然是 alpha 状态(自 v1.22 起),另一些示例则仅使用 seccomp 正式发布的功能。
80
+ 本篇教程演示的某些示例仍然是 Beta 状态(自 v1.25 起),另一些示例则仅使用 seccomp 正式发布的功能。
81
81
你应该确保,针对你使用的版本,
82
82
[ 正确配置] ( https://kind.sigs.k8s.io/docs/user/quick-start/#setting-kubernetes-version ) 了集群。
83
83
@@ -179,16 +179,16 @@ This tutorial assumes you are using Kubernetes {{< param "version" >}}.
179
179
本篇教程假定你正在使用 Kubernetes {{< param "version" >}}。
180
180
181
181
<!--
182
- As an alpha feature, you can configure Kubernetes to use the profile that the
182
+ As a beta feature, you can configure Kubernetes to use the profile that the
183
183
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}
184
184
prefers by default, rather than falling back to `Unconfined`.
185
185
If you want to try that, see
186
186
[enable the use of `RuntimeDefault` as the default seccomp profile for all workloads](#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads)
187
187
before you continue.
188
188
-->
189
- 作为 alpha 特性,你可以将 Kubernetes 配置为使用
190
- {{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}
191
- 默认首选的配置文件, 而不是回退到 ` Unconfined ` 。
189
+ 作为 Beta 特性,你可以将 Kubernetes
190
+ 配置为使用 {{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}默认首选的配置文件,
191
+ 而不是回退到 ` Unconfined ` 。
192
192
如果你想尝试,请在继续之前参阅
193
193
[ 启用使用 ` RuntimeDefault ` 作为所有工作负载的默认 seccomp 配置文件] ( #enable-runtimedefault-as-default ) 。
194
194
@@ -253,18 +253,21 @@ running within kind.
253
253
-->
254
254
## 启用使用 ` RuntimeDefault ` 作为所有工作负载的默认 seccomp 配置文件 {#enable-runtimedefault-as-default}
255
255
256
- {{< feature-state state="alpha " for_k8s_version="v1.22 " >}}
256
+ {{< feature-state state="beta " for_k8s_version="v1.25 " >}}
257
257
258
258
<!--
259
- `SeccompDefault` is an optional kubelet
260
- [feature gate](/docs/reference/command-line-tools-reference/feature-gates) as
261
- well as corresponding `--seccomp-default`
259
+ To use seccomp profile defaulting, you must run the kubelet with the `SeccompDefault`
260
+ [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) enabled
261
+ (this is the default). You must also explicitly enable the defaulting behavior for each
262
+ node where you want to use this with the corresponding `--seccomp-default`
262
263
[command line flag](/docs/reference/command-line-tools-reference/kubelet).
263
264
Both have to be enabled simultaneously to use the feature.
264
265
-->
265
- ` SeccompDefault ` 是一个可选的 kubelet [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates )
266
- 以及相应的 ` --seccomp-default ` [ 命令行标志] ( /zh-cn/docs/reference/command-line-tools-reference/kubelet ) 。
267
- 两者必须同时启用才能使用该功能。
266
+ 要使用 Seccomp(安全计算模式)配置文件来设定默认值,你必须要在启用 ` SeccompDefault `
267
+ [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) 的情况下运行 kubelet
268
+ (这是默认值)。
269
+ 你还必须显式地启用每个节点的默认行为,以及相应的
270
+ ` --seccomp-default ` [ 命令行标志] ( /zh-cn/docs/reference/command-line-tools-reference/kubelet ) 。两者必须同时启用才能使用该特性。
268
271
269
272
<!--
270
273
If enabled, the kubelet will use the `RuntimeDefault` seccomp profile by default, which is
@@ -311,36 +314,52 @@ profile. To mitigate such a failure, you can:
311
314
要应对此类故障,你可以:
312
315
313
316
- 将工作负载显式运行为 ` Unconfined ` 。
314
- - 禁用节点的 ` SeccompDefault ` 功能。还要确保工作负载被调度到禁用该功能的节点上 。
317
+ - 禁用节点的 ` SeccompDefault ` 特性。还要确保工作负载被调度到禁用该特性的节点上 。
315
318
- 为工作负载创建自定义 seccomp 配置文件。
316
319
317
320
<!--
318
321
If you were introducing this feature into production-like cluster, the Kubernetes project
319
322
recommends that you enable this feature gate on a subset of your nodes and then
320
323
test workload execution before rolling the change out cluster-wide.
321
324
322
- More detailed information about a possible upgrade and downgrade strategy can be
323
- found in the [related Kubernetes Enhancement Proposal (KEP)](https://github.com/kubernetes/enhancements/tree/a70cc18/keps/sig-node/2413-seccomp-by-default#upgrade--downgrade-strategy).
325
+ You can find more detailed information about a possible upgrade and downgrade strategy
326
+ in the related Kubernetes Enhancement Proposal (KEP):
327
+ [Enable seccomp by default](https://github.com/kubernetes/enhancements/tree/9a124fd29d1f9ddf2ff455c49a630e3181992c25/keps/sig-node/2413-seccomp-by-default#upgrade--downgrade-strategy).
324
328
-->
325
- 如果你将此功能引入到类似生产的集群中 ,
329
+ 如果你将此特性引入到类似的生产集群中 ,
326
330
Kubernetes 项目建议你在部分节点上启用此特性门控,
327
331
然后在整个集群范围内推出更改之前,测试工作负载执行情况。
328
332
329
- 有关可能的升级和降级策略的更多详细信息,
330
- 请参阅[ 相关的 Kubernetes 增强提案 (KEP)] ( https://github.com/kubernetes/enhancements/tree/a70cc18/keps/sig-node/2413-seccomp-by-default#upgrade--downgrade-strategy ) 。
333
+ 你可以在相关的 Kubernetes 增强提案(KEP)
334
+ 中找到可能的升级和降级策略的更详细信息:
335
+ [ 默认启用 Seccomp] ( https://github.com/kubernetes/enhancements/tree/9a124fd29d1f9ddf2ff455c49a630e3181992c25/keps/sig-node/2413-seccomp-by-default#upgrade--downgrade-strategy ) 。
331
336
332
- <!--
333
- Since the feature is in alpha state it is disabled per default. To enable it,
334
- pass the flags `--feature-gates=SeccompDefault=true --seccomp-default` to the
335
- `kubelet` CLI or enable it via the [kubelet configuration
337
+ <!--
338
+ Kubernetes {{< skew currentVersion >}} lets you configure the seccomp profile
339
+ that applies when the spec for a Pod doesn't define a specific seccomp profile.
340
+ This is a beta feature and the corresponding `SeccompDefault` [feature
341
+ gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled by
342
+ default. However, you still need to enable this defaulting for each node where
343
+ you would like to use it.
344
+ -->
345
+ Kubernetes {{< skew currentVersion >}} 允许你配置 Seccomp 配置文件,
346
+ 当 Pod 的规约未定义特定的 Seccomp 配置文件时应用该配置文件。
347
+ 这是一个 Beta 特性,默认启用相应的 ` SeccompDefault ` [ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) 。
348
+ 但是,你仍然需要为要使用它的每个节点启用此默认设置。
349
+
350
+ <!--
351
+ If you are running a Kubernetes {{< skew currentVersion >}} cluster and want to
352
+ enable the feature, either run the kubelet with the `--seccomp-default` command
353
+ line flag, or enable it through the [kubelet configuration
336
354
file](/docs/tasks/administer-cluster/kubelet-config-file/). To enable the
337
355
feature gate in [kind](https://kind.sigs.k8s.io), ensure that `kind` provides
338
356
the minimum required Kubernetes version and enables the `SeccompDefault` feature
339
357
[in the kind configuration](https://kind.sigs.k8s.io/docs/user/quick-start/#enable-feature-gates-in-your-cluster):
340
358
-->
341
- 由于此特性处于 alpha 阶段,默认是被禁用的。
342
- 要启用它,传递标志 ` --feature-gates=SeccompDefault=true --seccomp-default ` 到
343
- kubelet CLI 或者通过 [ kubelet 配置文件] ( /docs/tasks/administer-cluster/kubelet-config-file/ ) 启用。
359
+ 如果你正在运行 Kubernetes {{< skew currentVersion >}}
360
+ 集群并希望启用该特性,请使用 ` --seccomp-default ` 命令行参数运行 kubelet,
361
+ 或通过 [ kubelet 配置文件] ( /zh-cn/docs/tasks/administer-cluster/kubelet-config-file/ ) 启用。
362
+
344
363
要在 [ kind] ( https://kind.sigs.k8s.io ) 启用特性门控,
345
364
请确保 ` kind ` 提供所需的最低 Kubernetes 版本,
346
365
并[ 在 kind 配置中] ( https://kind.sigs.k8s.io/docs/user/quick-start/#enable-feature-gates-in-your-cluster )
@@ -426,13 +445,23 @@ Here's a manifest for that Pod:
426
445
The functional support for the already deprecated seccomp annotations
427
446
`seccomp.security.alpha.kubernetes.io/pod` (for the whole pod) and
428
447
`container.seccomp.security.alpha.kubernetes.io/[name]` (for a single container)
429
- is going to be removed with the release of Kubernetes v1.25 . Please always use
448
+ is going to be removed with a future release of Kubernetes. Please always use
430
449
the native API fields in favor of the annotations.
450
+
451
+ Since Kubernetes v1.25, kubelets no longer support the annotations, use of the
452
+ annotations in static pods is no longer supported, and the seccomp annotations
453
+ are no longer auto-populated when pods with seccomp fields are created.
454
+ Auto-population of the seccomp fields from the annotations is planned to be
455
+ removed in a future release.
431
456
-->
432
457
已弃用的 seccomp 注解 ` seccomp.security.alpha.kubernetes.io/pod ` (针对整个 Pod)和
433
458
` container.seccomp.security.alpha.kubernetes.io/[name] ` (针对单个容器)
434
- 将随着 Kubernetes v1.25 的发布而被删除。
459
+ 将随着未来 Kubernetes 的发布而被删除。
435
460
请在可能的情况下使用原生 API 字段而不是注解。
461
+
462
+ 从 Kubernetes v1.25 开始,kubelet 不再支持这些注解,
463
+ 也不再支持在静态 Pod 中使用注解,并且当创建带有 seccomp 字段的 Pod 时不再自动填充 seccomp 注解。
464
+ 从注释中自动填充 seccomp 字段的特性,将计划在未来的版本中删除。
436
465
{{< /note >}}
437
466
438
467
<!--
0 commit comments