@@ -141,6 +141,7 @@ CSI ephemeral volumes are only supported by a subset of CSI drivers.
141
141
The Kubernetes CSI [Drivers list](https://kubernetes-csi.github.io/docs/drivers.html)
142
142
shows which drivers support ephemeral volumes.
143
143
-->
144
+
144
145
该特性需要启用参数 ` CSIInlineVolume `
145
146
[ 特性门控(feature gate)] ( /zh/docs/reference/command-line-tools-reference/feature-gates/ ) 。
146
147
该参数从 Kubernetes 1.16 开始默认启用。
@@ -158,7 +159,7 @@ Conceptually, CSI ephemeral volumes are similar to `configMap`,
158
159
scheduled onto a node. Kubernetes has no concept of rescheduling Pods
159
160
anymore at this stage. Volume creation has to be unlikely to fail,
160
161
otherwise Pod startup gets stuck. In particular, [storage capacity
161
- aware Pod scheduling](/docs/concepts/storage-capacity/) is *not*
162
+ aware Pod scheduling](/docs/concepts/storage/storage -capacity/) is *not*
162
163
supported for these volumes. They are currently also not covered by
163
164
the storage resource usage limits of a Pod, because that is something
164
165
that kubelet can only enforce for storage that it manages itself.
@@ -218,19 +219,22 @@ As a cluster administrator, you can use a [PodSecurityPolicy](/docs/concepts/pol
218
219
-->
219
220
# ## 通用临时卷 {#generic-ephemeral-volumes}
220
221
221
- {{< feature-state for_k8s_version="v1.19 " state="alpha " >}}
222
+ {{< feature-state for_k8s_version="v1.21 " state="beta " >}}
222
223
223
224
<!--
224
225
This feature requires the `GenericEphemeralVolume` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be
225
- enabled. Because this is an alpha feature, it is disabled by default.
226
+ enabled. Because this is a beta feature, it is enabled by default.
226
227
-->
227
228
这个特性需要启用 `GenericEphemeralVolume`
228
229
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
229
- 因为这是一个alpha特性,默认禁用 。
230
+ 因为这是一个 beta 特性,默认情况下启用 。
230
231
231
232
<!--
232
- Generic ephemeral volumes are similar to `emptyDir` volumes, just more
233
- flexible :
233
+ Generic ephemeral volumes are similar to `emptyDir` volumes in the
234
+ sense that they provide a per-pod directory for scratch data that is
235
+ usually empty after provisioning. But they may also have additional
236
+ features :
237
+
234
238
- Storage can be local or network-attached.
235
239
- Volumes can have a fixed size that Pods are not able to exceed.
236
240
- Volumes may have some initial data, depending on the driver and
@@ -240,11 +244,13 @@ flexible:
240
244
([snapshotting](/docs/concepts/storage/volume-snapshots/),
241
245
[cloning](/docs/concepts/storage/volume-pvc-datasource/),
242
246
[resizing](/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims),
243
- and [storage capacity tracking](/docs/concepts/storage-capacity/).
247
+ and [storage capacity tracking](/docs/concepts/storage/storage -capacity/).
244
248
245
249
Example :
246
250
-->
247
- 通用临时卷类似于 `emptyDir` 卷,但更加灵活:
251
+ 通用临时卷与 `emptyDir` 卷类似,因为它们为暂存数据提供了一个 per-pod 的目录,该目录通常在置备后为空。
252
+ 但他们可能还会有其他特征:
253
+
248
254
- 存储可以是本地的,也可以是网络连接的。
249
255
- 卷可以有固定的大小,pod不能超量使用。
250
256
- 卷可能有一些初始数据,这取决于驱动程序和参数。
@@ -408,23 +414,28 @@ two choices:
408
414
集群管理员必须意识到这一点。
409
415
如果这不符合他们的安全模型,他们有两种选择:
410
416
<!--
411
- - Explicitly disable the feature through the feature gate, to avoid
412
- being surprised when some future Kubernetes version enables it
413
- by default.
417
+ - Explicitly disable the feature through the feature gate.
414
418
- Use a [Pod Security
415
419
Policy](/docs/concepts/policy/pod-security-policy/) where the
416
- ` volumes` list does not contain the `ephemeral` volume type.
420
+ ` volumes` list does not contain the `ephemeral` volume type
421
+ (deprecated in Kubernetes 1.21).
422
+ - Use an [admission webhook](/docs/reference/access-authn-authz/extensible-admission-controllers/)
423
+ which rejects objects like Pods that have a generic ephemeral
424
+ volume.
417
425
-->
418
- - 通过特性门控显式禁用该特性,可以避免将来的 Kubernetes 版本默认启用时带来混乱 。
426
+ - 通过特性门控显式禁用该特性。
419
427
- 当`卷`列表不包含 `ephemeral` 卷类型时,使用
420
- [Pod 安全策略](/zh/docs/concepts/policy/pod-security-policy/)。
428
+ [Pod 安全策略](/zh/docs/concepts/policy/pod-security-policy/)
429
+ (在 Kubernetes 1.21 中已弃用)。
430
+ - 使用[准入 Webhook](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
431
+ 拒绝像 Pod 这样具有通用临时卷。
421
432
422
433
<!--
423
- The normal namespace quota for PVCs in a namespace still applies, so
434
+ The normal [ namespace quota for PVCs](/docs/concepts/policy/resource-quotas/#storage-resource-quota) still applies, so
424
435
even if users are allowed to use this new mechanism, they cannot use
425
436
it to circumvent other policies.
426
437
-->
427
- 在一个命名空间中,用于 PVCs 的常规命名空间配额仍然适用 ,
438
+ 在一个命名空间中,用于 PVCs 的常规命名空间配额[用于 PVCs 的常规命名空间配额](/zh/docs/concepts/policy/resource-quotas/#storage-resource-quota)仍然适用 ,
428
439
因此即使允许用户使用这种新机制,他们也不能使用它来规避其他策略。
429
440
430
441
# # {{% heading "whatsnext" %}}
0 commit comments