Skip to content

Commit ec0df1c

Browse files
authored
Merge pull request #25683 from jiaj12/patch-73
Update storage-classes.md
2 parents 1f0b604 + fbbd5b4 commit ec0df1c

File tree

1 file changed

+74
-33
lines changed

1 file changed

+74
-33
lines changed

content/zh/docs/concepts/storage/storage-classes.md

Lines changed: 74 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ Kubernetes 本身并不清楚各种类代表的什么。这个类的概念在其
4242
## The StorageClass Resource
4343
4444
Each StorageClass contains the fields `provisioner`, `parameters`, and
45-
`reclaimPolicy`, which are used when a `PersistentVolume` belonging to the
45+
`reclaimPolicy`, which are used when a PersistentVolume belonging to the
4646
class needs to be dynamically provisioned.
47+
4748
-->
4849
## StorageClass 资源
4950

5051
每个 StorageClass 都包含 `provisioner``parameters``reclaimPolicy` 字段,
51-
这些字段会在 StorageClass 需要动态分配 `PersistentVolume` 时会使用到。
52+
这些字段会在 StorageClass 需要动态分配 PersistentVolume 时会使用到。
5253

5354
<!--
5455
The name of a StorageClass object is significant, and is how users can
@@ -155,7 +156,7 @@ vendors provide their own external provisioner.
155156
<!--
156157
### Reclaim Policy
157158
158-
PersistentVolumes that are dynamically created by a storage class will have the
159+
PersistentVolumes that are dynamically created by a StorageClass will have the
159160
reclaim policy specified in the `reclaimPolicy` field of the class, which can be
160161
either `Delete` or `Retain`. If no `reclaimPolicy` is specified when a
161162
StorageClass object is created, it will default to `Delete`.
@@ -183,18 +184,18 @@ PersistentVolumes can be configured to be expandable. This feature when set to `
183184
allows the users to resize the volume by editing the corresponding PVC object.
184185

185186
The following types of volumes support volume expansion, when the underlying
186-
Storage Class has the field `allowVolumeExpansion` set to true.
187+
StorageClass has the field `allowVolumeExpansion` set to true.
187188
-->
188189
PersistentVolume 可以配置为可扩展。将此功能设置为 `true` 时,允许用户通过编辑相应的 PVC 对象来调整卷大小。
189190

190-
当基础存储类的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
191+
当下层 StorageClass 的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
191192

192193
{{< table caption = "Table of Volume types and the version of Kubernetes they require" >}}
193194

194195
<!--
195196
Volume type | Required Kubernetes version
196197
-->
197-
| 卷类型 | Kubernetes 版本要求 |
198+
| 卷类型 | Kubernetes 版本要求 |
198199
|:---------------------|:--------------------------|
199200
| gcePersistentDisk | 1.11 |
200201
| awsElasticBlockStore | 1.11 |
@@ -261,19 +262,19 @@ A cluster administrator can address this issue by specifying the `WaitForFirstCo
261262
will delay the binding and provisioning of a PersistentVolume until a Pod using the PersistentVolumeClaim is created.
262263
PersistentVolumes will be selected or provisioned conforming to the topology that is
263264
specified by the Pod's scheduling constraints. These include, but are not limited to, [resource
264-
requirements](/docs/concepts/configuration/manage-compute-resources-container),
265-
[node selectors](/docs/concepts/configuration/assign-pod-node/#nodeselector),
265+
requirements](/docs/concepts/configuration/manage-resources-containers/),
266+
[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector),
266267
[pod affinity and
267-
anti-affinity](/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity),
268-
and [taints and tolerations](/docs/concepts/configuration/taint-and-toleration).
268+
anti-affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity),
269+
and [taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration).
269270
-->
270271
集群管理员可以通过指定 `WaitForFirstConsumer` 模式来解决此问题。
271272
该模式将延迟 PersistentVolume 的绑定和制备,直到使用该 PersistentVolumeClaim 的 Pod 被创建。
272273
PersistentVolume 会根据 Pod 调度约束指定的拓扑来选择或制备。这些包括但不限于
273274
[资源需求](/zh/docs/concepts/configuration/manage-resources-containers/)、
274275
[节点筛选器](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)、
275-
[pod 亲和性和互斥性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)、
276-
以及[污点和容忍度](/zh/docs/concepts/scheduling-eviction/taint-and-toleration/)。
276+
[pod 亲和性和互斥性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity/)、
277+
以及[污点和容忍度](/zh/docs/concepts/scheduling-eviction/taint-and-toleration)。
277278

278279
<!--
279280
The following plugins support `WaitForFirstConsumer` with dynamic provisioning:
@@ -299,7 +300,7 @@ The following plugins support `WaitForFirstConsumer` with pre-created Persistent
299300
* 上述全部
300301
* [Local](#local)
301302

302-
{{< feature-state state="beta" for_k8s_version="1.17" >}}
303+
{{< feature-state state="stable" for_k8s_version="v1.17" >}}
303304

304305
<!--
305306
[CSI volumes](/docs/concepts/storage/volumes/#csi) are also supported with dynamic provisioning
@@ -352,7 +353,7 @@ allowedTopologies:
352353
<!--
353354
## Parameters
354355

355-
Storage classes have parameters that describe volumes belonging to the storage
356+
Storage Classes have parameters that describe volumes belonging to the storage
356357
class. Different parameters may be accepted depending on the `provisioner`. For
357358
example, the value `io1`, for the parameter `type`, and the parameter
358359
`iopsPerGB` are specific to EBS. When a parameter is omitted, some default is
@@ -364,7 +365,7 @@ exceed 256 KiB.
364365
-->
365366
## 参数
366367

367-
Storage class 具有描述属于卷的参数。取决于制备器,可以接受不同的参数。
368+
Storage Classes 的参数描述了存储类的卷。取决于制备器,可以接受不同的参数。
368369
例如,参数 type 的值 io1 和参数 iopsPerGB 特定于 EBS PV。
369370
当参数被省略时,会使用默认值。
370371

@@ -387,7 +388,7 @@ parameters:
387388

388389
<!--
389390
* `type`: `io1`, `gp2`, `sc1`, `st1`. See
390-
[AWS docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
391+
[AWS docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
391392
for details. Default: `gp2`.
392393
* `zone` (Deprecated): AWS zone. If neither `zone` nor `zones` is specified, volumes are
393394
generally round-robin-ed across all active zones where Kubernetes cluster
@@ -399,7 +400,7 @@ parameters:
399400
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS
400401
volume plugin multiplies this with size of requested volume to compute IOPS
401402
of the volume and caps it at 20 000 IOPS (maximum supported by AWS, see
402-
[AWS docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
403+
[AWS docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
403404
A string is expected here, i.e. `"10"`, not `10`.
404405
* `fsType`: fsType that is supported by kubernetes. Default: `"ext4"`.
405406
* `encrypted`: denotes whether the EBS volume should be encrypted or not.
@@ -446,6 +447,7 @@ metadata:
446447
provisioner: kubernetes.io/gce-pd
447448
parameters:
448449
type: pd-standard
450+
fstype: ext4
449451
replication-type: none
450452
```
451453

@@ -479,19 +481,21 @@ If `replication-type` is set to `none`, a regular (zonal) PD will be provisioned
479481
<!--
480482
If `replication-type` is set to `regional-pd`, a
481483
[Regional Persistent Disk](https://cloud.google.com/compute/docs/disks/#repds)
482-
will be provisioned. In this case, users must use `zones` instead of `zone` to
483-
specify the desired replication zones. If exactly two zones are specified, the
484-
Regional PD will be provisioned in those zones. If more than two zones are
485-
specified, Kubernetes will arbitrarily choose among the specified zones. If the
486-
`zones` parameter is omitted, Kubernetes will arbitrarily choose among zones
487-
managed by the cluster.
484+
will be provisioned. It's highly recommended to have
485+
`volumeBindingMode: WaitForFirstConsumer` set, in which case when you create
486+
a Pod that consumes a PersistentVolumeClaim which uses this StorageClass, a
487+
Regional Persistent Disk is provisioned with two zones. One zone is the same
488+
as the zone that the Pod is scheduled in. The other zone is randomly picked
489+
from the zones available to the cluster. Disk zones can be further constrained
490+
using `allowedTopologies`.
488491
-->
489492
如果 `replication-type` 设置为 `regional-pd`,会制备一个
490493
[区域性持久化磁盘(Regional Persistent Disk)](https://cloud.google.com/compute/docs/disks/#repds)。
491-
在这种情况下,用户必须使用 `zones` 而非 `zone` 来指定期望的复制区域(zone)。
492-
如果指定来两个特定的区域,区域性持久化磁盘会在这两个区域里制备。
493-
如果指定了多于两个的区域,Kubernetes 会选择其中任意两个区域。
494-
如果省略了 `zones` 参数,Kubernetes 会在集群管理的区域中任意选择。
494+
495+
强烈建议设置 `volumeBindingMode: WaitForFirstConsumer`,这样设置后,
496+
当你创建一个 Pod,它使用的 PersistentVolumeClaim 使用了这个 StorageClass,
497+
区域性持久化磁盘会在两个区域里制备。 其中一个区域是 Pod 所在区域。
498+
另一个区域是会在集群管理的区域中任意选择。磁盘区域可以通过 `allowedTopologies` 加以限制。
495499

496500
<!--
497501
`zone` and `zones` parameters are deprecated and replaced with
@@ -555,7 +559,7 @@ parameters:
555559
contains user password to use when talking to Gluster REST service. These
556560
parameters are optional, empty password will be used when both
557561
`secretNamespace` and `secretName` are omitted. The provided secret must have
558-
type `"kubernetes.io/glusterfs"`, e.g. created in this way:
562+
type `"kubernetes.io/glusterfs"`, for example created in this way:
559563

560564
```
561565
kubectl create secret generic heketi-secret \
@@ -586,15 +590,15 @@ parameters:
586590
`"8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"`. This
587591
is an optional parameter.
588592
* `gidMin`, `gidMax` : The minimum and maximum value of GID range for the
589-
storage class. A unique value (GID) in this range ( gidMin-gidMax ) will be
593+
StorageClass. A unique value (GID) in this range ( gidMin-gidMax ) will be
590594
used for dynamically provisioned volumes. These are optional values. If not
591595
specified, the volume will be provisioned with a value between 2000-2147483647
592596
which are defaults for gidMin and gidMax respectively.
593597
-->
594598
* `clusterid`:`630372ccdc720a92c681fb928f27b53f` 是集群的 ID,当制备卷时,
595599
Heketi 将会使用这个文件。它也可以是一个 clusterid 列表,例如:
596600
`"8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"`。这个是可选参数。
597-
* `gidMin`,`gidMax`:storage class GID 范围的最小值和最大值。
601+
* `gidMin`,`gidMax`:StorageClass GID 范围的最小值和最大值。
598602
在此范围(gidMin-gidMax)内的唯一值(GID)将用于动态制备卷。这些是可选的值。
599603
如果不指定,所制备的卷为一个 2000-2147483647 之间的值,这是 gidMin 和
600604
gidMax 的默认值。
@@ -658,7 +662,7 @@ parameters:
658662

659663
<!--
660664
{{< note >}}
661-
{{< feature-state state="deprecated" for_k8s_version="1.11" >}}
665+
{{< feature-state state="deprecated" for_k8s_version="v1.11" >}}
662666
This internal provisioner of OpenStack is deprecated. Please use [the external cloud provider for OpenStack](https://github.com/kubernetes/cloud-provider-openstack).
663667
{{< /note >}}
664668
-->
@@ -670,6 +674,44 @@ OpenStack 的内部驱动已经被弃用。请使用
670674

671675
### vSphere
672676

677+
<!--
678+
There are two types of provisioners for vSphere storage classes:
679+
680+
- [CSI provisioner](#csi-provisioner): `csi.vsphere.vmware.com`
681+
- [vCP provisioner](#vcp-provisioner): `kubernetes.io/vsphere-volume`
682+
683+
In-tree provisioners are [deprecated](/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi). For more information on the CSI provisioner, see [Kubernetes vSphere CSI Driver](https://vsphere-csi-driver.sigs.k8s.io/) and [vSphereVolume CSI migration](/docs/concepts/storage/volumes/#csi-migration-5).
684+
-->
685+
vSphere 存储类有两种制备器
686+
687+
- [CSI 制备器](#csi-provisioner): `csi.vsphere.vmware.com`
688+
- [vCP 制备器](#vcp-provisioner): `kubernetes.io/vsphere-volume`
689+
690+
树内制备器已经被
691+
[弃用](/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi)。
692+
更多关于 CSI 制备器的详情,请参阅
693+
[Kubernetes vSphere CSI 驱动](https://vsphere-csi-driver.sigs.k8s.io/)
694+
和 [vSphereVolume CSI 迁移](/docs/concepts/storage/volumes/#csi-migration-5)。
695+
696+
<!--
697+
#### CSI Provisioner {#vsphere-provisioner-csi}
698+
699+
The vSphere CSI StorageClass provisioner works with Tanzu Kubernetes clusters. For an example, refer to the [vSphere CSI repository](https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/master/example/vanilla-k8s-file-driver/example-sc.yaml).
700+
-->
701+
#### CSI 制备器 {#vsphere-provisioner-csi}
702+
703+
vSphere CSI StorageClass 制备器在 Tanzu Kubernetes 集群下运行。示例请参
704+
[vSphere CSI 仓库](https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/master/example/vanilla-k8s-file-driver/example-sc.yaml)。
705+
706+
<!--
707+
#### vCP Provisioner
708+
709+
The following examples use the VMware Cloud Provider (vCP) StorageClass provisioner.
710+
-->
711+
#### vCP 制备器
712+
713+
以下示例使用 VMware Cloud Provider (vCP) StorageClass 调度器
714+
673715
<!--
674716
1. Create a StorageClass with a user specified disk format.
675717
-->
@@ -1314,5 +1356,4 @@ scheduling constraints when choosing an appropriate PersistentVolume for a
13141356
PersistentVolumeClaim.
13151357
-->
13161358
延迟卷绑定使得调度器在为 PersistentVolumeClaim 选择一个合适的
1317-
PersistentVolume 时能考虑到所有 Pod 的调度限制。
1318-
1359+
PersistentVolume 时能考虑到所有 Pod 的调度限制。

0 commit comments

Comments
 (0)