Skip to content

Commit 13f45f4

Browse files
authored
Merge pull request #33544 from mengjiao-liu/sync-1.24-ephemeral-volumes
[zh]Sync ephemeral-volumes.md
2 parents aa12eb6 + 630bef1 commit 13f45f4

File tree

1 file changed

+23
-45
lines changed

1 file changed

+23
-45
lines changed

content/zh/docs/concepts/storage/ephemeral-volumes.md

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ _临时卷_ 就是为此类用例设计的。因为卷会遵从 Pod 的生命周
5555
Ephemeral volumes are specified _inline_ in the Pod spec, which
5656
simplifies application deployment and management.
5757
-->
58-
临时卷在 Pod 规范中以 _内联_ 方式定义,这简化了应用程序的部署和管理。
58+
临时卷在 Pod 规约中以 _内联_ 方式定义,这简化了应用程序的部署和管理。
5959

6060
<!--
6161
### Types of ephemeral volumes
@@ -211,13 +211,19 @@ instructions.
211211
<!--
212212
### CSI driver restrictions
213213

214-
As a cluster administrator, you can use a [PodSecurityPolicy](/docs/concepts/security/pod-security-policy/) to control which CSI drivers can be used in a Pod, specified with the
215-
[`allowedCSIDrivers` field](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicyspec-v1beta1-policy).
214+
CSI ephemeral volumes allow users to provide `volumeAttributes`
215+
directly to the CSI driver as part of the Pod spec. A CSI driver
216+
allowing `volumeAttributes` that are typically restricted to
217+
administrators is NOT suitable for use in an inline ephemeral volume.
218+
For example, parameters that are normally defined in the StorageClass
219+
should not be exposed to users through the use of inline ephemeral volumes.
216220
-->
217221

218222
### CSI 驱动程序限制 {#csi-driver-restrictions}
219223

220-
{{< feature-state for_k8s_version="v1.21" state="deprecated" >}}
224+
CSI 临时卷允许用户直接向 CSI 驱动程序提供 `volumeAttributes`,它会作为 Pod 规约的一部分。
225+
允许 `volumeAttributes` 的 CSI 驱动程序通常仅限于管理员使用,不适合在内联临时卷中使用。
226+
例如,通常在 StorageClass 中定义的参数不应通过使用内联临时卷向用户公开。
221227

222228
作为一个集群管理员,你可以使用
223229
[PodSecurityPolicy](/zh/docs/concepts/security/pod-security-policy/)
@@ -226,28 +232,15 @@ As a cluster administrator, you can use a [PodSecurityPolicy](/docs/concepts/sec
226232
指定。
227233

228234
<!--
229-
{{< note >}}
230-
PodSecurityPolicy is deprecated and will be removed in the Kubernetes v1.25 release.
231-
{{< /note >}}
235+
Cluster administrators who need to restrict the CSI drivers that are
236+
allowed to be used as inline volumes within a Pod spec may do so by:
237+
- Removing `Ephemeral` from `volumeLifecycleModes` in the CSIDriver spec, which prevents the driver from being used as an inline ephemeral volume.
238+
- Using an [admission webhook](/docs/reference/access-authn-authz/extensible-admission-controllers/) to restrict how this driver is used.
232239
-->
233-
234-
{{< note >}}
235-
PodSecurityPolicy 已弃用,并将在 Kubernetes v1.25 版本中移除。
236-
{{< /note >}}
237-
238-
239-
<!--
240-
{{< note >}}
241-
CSI ephemeral volumes are only supported by a subset of CSI drivers.
242-
The Kubernetes CSI [Drivers list](https://kubernetes-csi.github.io/docs/drivers.html)
243-
shows which drivers support ephemeral volumes.
244-
{{< /note >}}
245-
-->
246-
247-
{{< note >}}
248-
CSI 临时卷仅有 CSI 驱动程序的一个子集支持。
249-
Kubernetes CSI [驱动列表](https://kubernetes-csi.github.io/docs/drivers.html)显示了哪些驱动程序支持临时卷。
250-
{{< /note >}}
240+
如果集群管理员需要限制 CSI 驱动程序在 Pod 规约中被作为内联卷使用,可以这样做:
241+
- 从 CSIDriver 规约的 `volumeLifecycleModes` 中删除 `Ephemeral`,这可以防止驱动程序被用作内联临时卷。
242+
- 使用[准入 Webhook](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
243+
来限制如何使用此驱动程序。
251244

252245
<!--
253246
### Generic ephemeral volumes
@@ -279,7 +272,7 @@ Example:
279272
在最初制备完毕时一般为空。不过通用临时卷也有一些额外的功能特性:
280273

281274
- 存储可以是本地的,也可以是网络连接的。
282-
- 卷可以有固定的大小,pod不能超量使用
275+
- 卷可以有固定的大小,Pod 不能超量使用
283276
- 卷可能有一些初始数据,这取决于驱动程序和参数。
284277
- 当驱动程序支持,卷上的典型操作将被支持,包括
285278
([快照](/zh/docs/concepts/storage/volume-snapshots/)、
@@ -437,29 +430,14 @@ same namespace, so that these conflicts can't occur.
437430
Enabling the GenericEphemeralVolume feature allows users to create
438431
PVCs indirectly if they can create Pods, even if they do not have
439432
permission to create PVCs directly. Cluster administrators must be
440-
aware of this. If this does not fit their security model, they have
441-
two choices:
433+
aware of this. If this does not fit their security model, they should
434+
use an [admission webhook](/docs/reference/access-authn-authz/extensible-admission-controllers/) that rejects objects like Pods that have a generic ephemeral volume.
442435
-->
443436
启用 GenericEphemeralVolume 特性会导致那些没有 PVCs 创建权限的用户,
444437
在创建 Pods 时,被允许间接的创建 PVCs。
445438
集群管理员必须意识到这一点。
446-
如果这不符合他们的安全模型,他们有如下选择:
447-
448-
<!--
449-
- Use an [admission webhook](/docs/reference/access-authn-authz/extensible-admission-controllers/)
450-
that rejects objects like Pods that have a generic ephemeral
451-
volume.
452-
- Use a [Pod Security
453-
Policy](/docs/concepts/policy/pod-security-policy/) where the
454-
`volumes` list does not contain the `ephemeral` volume type
455-
(deprecated in Kubernetes 1.21).
456-
-->
457-
- 通过特性门控显式禁用该特性。
458-
- 使用一个[准入 Webhook](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
459-
拒绝包含通用临时卷的 Pods。
460-
- 当 `volumes` 列表不包含 `ephemeral` 卷类型时,使用
461-
[Pod 安全策略](/zh/docs/concepts/policy/pod-security-policy/)。
462-
(这一方式在 Kubernetes 1.21 版本已经弃用)
439+
如果这不符合他们的安全模型,他们应该使用一个[准入 Webhook](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
440+
拒绝包含通用临时卷的 Pods。
463441

464442
<!--
465443
The normal [namespace quota for PVCs](/docs/concepts/policy/resource-quotas/#storage-resource-quota) still applies, so

0 commit comments

Comments
 (0)