@@ -42,13 +42,14 @@ Kubernetes 本身并不清楚各种类代表的什么。这个类的概念在其
42
42
## The StorageClass Resource
43
43
44
44
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
46
46
class needs to be dynamically provisioned.
47
+
47
48
-->
48
49
## StorageClass 资源
49
50
50
51
每个 StorageClass 都包含 ` provisioner ` 、` parameters ` 和 ` reclaimPolicy ` 字段,
51
- 这些字段会在 StorageClass 需要动态分配 ` PersistentVolume ` 时会使用到。
52
+ 这些字段会在 StorageClass 需要动态分配 PersistentVolume 时会使用到。
52
53
53
54
<!--
54
55
The name of a StorageClass object is significant, and is how users can
@@ -155,7 +156,7 @@ vendors provide their own external provisioner.
155
156
<!--
156
157
### Reclaim Policy
157
158
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
159
160
reclaim policy specified in the ` reclaimPolicy` field of the class, which can be
160
161
either `Delete` or `Retain`. If no `reclaimPolicy` is specified when a
161
162
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 `
183
184
allows the users to resize the volume by editing the corresponding PVC object.
184
185
185
186
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.
187
188
-->
188
189
PersistentVolume 可以配置为可扩展。将此功能设置为 `true` 时,允许用户通过编辑相应的 PVC 对象来调整卷大小。
189
190
190
- 当基础存储类的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
191
+ 当下层 StorageClass 的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
191
192
192
193
{{< table caption = "Table of Volume types and the version of Kubernetes they require" >}}
193
194
194
195
<!--
195
196
Volume type | Required Kubernetes version
196
197
-->
197
- | 卷类型 | Kubernetes 版本要求 |
198
+ | 卷类型 | Kubernetes 版本要求 |
198
199
|:---------------------|:--------------------------|
199
200
| gcePersistentDisk | 1.11 |
200
201
| awsElasticBlockStore | 1.11 |
@@ -261,19 +262,19 @@ A cluster administrator can address this issue by specifying the `WaitForFirstCo
261
262
will delay the binding and provisioning of a PersistentVolume until a Pod using the PersistentVolumeClaim is created.
262
263
PersistentVolumes will be selected or provisioned conforming to the topology that is
263
264
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),
266
267
[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).
269
270
-->
270
271
集群管理员可以通过指定 `WaitForFirstConsumer` 模式来解决此问题。
271
272
该模式将延迟 PersistentVolume 的绑定和制备,直到使用该 PersistentVolumeClaim 的 Pod 被创建。
272
273
PersistentVolume 会根据 Pod 调度约束指定的拓扑来选择或制备。这些包括但不限于
273
274
[资源需求](/zh/docs/concepts/configuration/manage-resources-containers/)、
274
275
[节点筛选器](/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)。
277
278
278
279
<!--
279
280
The following plugins support `WaitForFirstConsumer` with dynamic provisioning :
@@ -299,7 +300,7 @@ The following plugins support `WaitForFirstConsumer` with pre-created Persistent
299
300
* 上述全部
300
301
* [Local](#local)
301
302
302
- {{< feature-state state="beta " for_k8s_version="1 .17" >}}
303
+ {{< feature-state state="stable " for_k8s_version="v1 .17" >}}
303
304
304
305
<!--
305
306
[CSI volumes](/docs/concepts/storage/volumes/#csi) are also supported with dynamic provisioning
@@ -352,7 +353,7 @@ allowedTopologies:
352
353
<!--
353
354
# # Parameters
354
355
355
- Storage classes have parameters that describe volumes belonging to the storage
356
+ Storage Classes have parameters that describe volumes belonging to the storage
356
357
class. Different parameters may be accepted depending on the `provisioner`. For
357
358
example, the value `io1`, for the parameter `type`, and the parameter
358
359
` iopsPerGB` are specific to EBS. When a parameter is omitted, some default is
@@ -364,7 +365,7 @@ exceed 256 KiB.
364
365
-->
365
366
# # 参数
366
367
367
- Storage class 具有描述属于卷的参数 。取决于制备器,可以接受不同的参数。
368
+ Storage Classes 的参数描述了存储类的卷 。取决于制备器,可以接受不同的参数。
368
369
例如,参数 type 的值 io1 和参数 iopsPerGB 特定于 EBS PV。
369
370
当参数被省略时,会使用默认值。
370
371
@@ -387,7 +388,7 @@ parameters:
387
388
388
389
<!--
389
390
* `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)
391
392
for details. Default : ` gp2` .
392
393
* `zone` (Deprecated): AWS zone. If neither `zone` nor `zones` is specified, volumes are
393
394
generally round-robin-ed across all active zones where Kubernetes cluster
@@ -399,7 +400,7 @@ parameters:
399
400
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS
400
401
volume plugin multiplies this with size of requested volume to compute IOPS
401
402
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).
403
404
A string is expected here, i.e. `"10"`, not `10`.
404
405
* `fsType`: fsType that is supported by kubernetes. Default: `"ext4"`.
405
406
* `encrypted`: denotes whether the EBS volume should be encrypted or not.
@@ -446,6 +447,7 @@ metadata:
446
447
provisioner: kubernetes.io/gce-pd
447
448
parameters:
448
449
type: pd-standard
450
+ fstype: ext4
449
451
replication-type: none
450
452
` ` `
451
453
@@ -479,19 +481,21 @@ If `replication-type` is set to `none`, a regular (zonal) PD will be provisioned
479
481
<!--
480
482
If `replication-type` is set to `regional-pd`, a
481
483
[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`.
488
491
-->
489
492
如果 `replication-type` 设置为 `regional-pd`,会制备一个
490
493
[区域性持久化磁盘(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` 加以限制。
495
499
496
500
<!--
497
501
` zone` and `zones` parameters are deprecated and replaced with
@@ -555,7 +559,7 @@ parameters:
555
559
contains user password to use when talking to Gluster REST service. These
556
560
parameters are optional, empty password will be used when both
557
561
` 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 :
559
563
560
564
```
561
565
kubectl create secret generic heketi-secret \
@@ -586,15 +590,15 @@ parameters:
586
590
` "8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"` . This
587
591
is an optional parameter.
588
592
* `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
590
594
used for dynamically provisioned volumes. These are optional values. If not
591
595
specified, the volume will be provisioned with a value between 2000-2147483647
592
596
which are defaults for gidMin and gidMax respectively.
593
597
-->
594
598
* `clusterid`:`630372ccdc720a92c681fb928f27b53f` 是集群的 ID,当制备卷时,
595
599
Heketi 将会使用这个文件。它也可以是一个 clusterid 列表,例如:
596
600
` "8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"` 。这个是可选参数。
597
- * `gidMin`,`gidMax`:storage class GID 范围的最小值和最大值。
601
+ * `gidMin`,`gidMax`:StorageClass GID 范围的最小值和最大值。
598
602
在此范围(gidMin-gidMax)内的唯一值(GID)将用于动态制备卷。这些是可选的值。
599
603
如果不指定,所制备的卷为一个 2000-2147483647 之间的值,这是 gidMin 和
600
604
gidMax 的默认值。
@@ -658,7 +662,7 @@ parameters:
658
662
659
663
<!--
660
664
{{< note >}}
661
- {{< feature-state state="deprecated" for_k8s_version="1 .11" >}}
665
+ {{< feature-state state="deprecated" for_k8s_version="v1 .11" >}}
662
666
This internal provisioner of OpenStack is deprecated. Please use [the external cloud provider for OpenStack](https://github.com/kubernetes/cloud-provider-openstack).
663
667
{{< /note >}}
664
668
-->
@@ -670,6 +674,44 @@ OpenStack 的内部驱动已经被弃用。请使用
670
674
671
675
# ## vSphere
672
676
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
+
673
715
<!--
674
716
1. Create a StorageClass with a user specified disk format.
675
717
-->
@@ -1314,5 +1356,4 @@ scheduling constraints when choosing an appropriate PersistentVolume for a
1314
1356
PersistentVolumeClaim.
1315
1357
-->
1316
1358
延迟卷绑定使得调度器在为 PersistentVolumeClaim 选择一个合适的
1317
- PersistentVolume 时能考虑到所有 Pod 的调度限制。
1318
-
1359
+ PersistentVolume 时能考虑到所有 Pod 的调度限制。
0 commit comments