From fbbd5b4f7533f1121c1c3670096806592f408ad8 Mon Sep 17 00:00:00 2001 From: jiajie Date: Thu, 17 Dec 2020 16:44:52 +0800 Subject: [PATCH] [zh] update content to match en master --- .../docs/concepts/storage/storage-classes.md | 107 ++++++++++++------ 1 file changed, 74 insertions(+), 33 deletions(-) diff --git a/content/zh/docs/concepts/storage/storage-classes.md b/content/zh/docs/concepts/storage/storage-classes.md index 0edc83cd0b..ae2dbf89b9 100644 --- a/content/zh/docs/concepts/storage/storage-classes.md +++ b/content/zh/docs/concepts/storage/storage-classes.md @@ -42,13 +42,14 @@ Kubernetes 本身并不清楚各种类代表的什么。这个类的概念在其 ## The StorageClass Resource Each StorageClass contains the fields `provisioner`, `parameters`, and -`reclaimPolicy`, which are used when a `PersistentVolume` belonging to the +`reclaimPolicy`, which are used when a PersistentVolume belonging to the class needs to be dynamically provisioned. + --> ## StorageClass 资源 每个 StorageClass 都包含 `provisioner`、`parameters` 和 `reclaimPolicy` 字段, -这些字段会在 StorageClass 需要动态分配 `PersistentVolume` 时会使用到。 +这些字段会在 StorageClass 需要动态分配 PersistentVolume 时会使用到。 PersistentVolume 可以配置为可扩展。将此功能设置为 `true` 时,允许用户通过编辑相应的 PVC 对象来调整卷大小。 -当基础存储类的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。 +当下层 StorageClass 的 `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。 {{< table caption = "Table of Volume types and the version of Kubernetes they require" >}} -| 卷类型 | Kubernetes 版本要求 | +| 卷类型 | Kubernetes 版本要求 | |:---------------------|:--------------------------| | gcePersistentDisk | 1.11 | | awsElasticBlockStore | 1.11 | @@ -261,19 +262,19 @@ A cluster administrator can address this issue by specifying the `WaitForFirstCo will delay the binding and provisioning of a PersistentVolume until a Pod using the PersistentVolumeClaim is created. PersistentVolumes will be selected or provisioned conforming to the topology that is specified by the Pod's scheduling constraints. These include, but are not limited to, [resource -requirements](/docs/concepts/configuration/manage-compute-resources-container), -[node selectors](/docs/concepts/configuration/assign-pod-node/#nodeselector), +requirements](/docs/concepts/configuration/manage-resources-containers/), +[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector), [pod affinity and -anti-affinity](/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity), -and [taints and tolerations](/docs/concepts/configuration/taint-and-toleration). +anti-affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity), +and [taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration). --> 集群管理员可以通过指定 `WaitForFirstConsumer` 模式来解决此问题。 该模式将延迟 PersistentVolume 的绑定和制备,直到使用该 PersistentVolumeClaim 的 Pod 被创建。 PersistentVolume 会根据 Pod 调度约束指定的拓扑来选择或制备。这些包括但不限于 [资源需求](/zh/docs/concepts/configuration/manage-resources-containers/)、 [节点筛选器](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)、 -[pod 亲和性和互斥性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)、 -以及[污点和容忍度](/zh/docs/concepts/scheduling-eviction/taint-and-toleration/)。 +[pod 亲和性和互斥性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity/)、 +以及[污点和容忍度](/zh/docs/concepts/scheduling-eviction/taint-and-toleration)。 ## 参数 -Storage class 具有描述属于卷的参数。取决于制备器,可以接受不同的参数。 +Storage Classes 的参数描述了存储类的卷。取决于制备器,可以接受不同的参数。 例如,参数 type 的值 io1 和参数 iopsPerGB 特定于 EBS PV。 当参数被省略时,会使用默认值。 @@ -387,7 +388,7 @@ parameters: 如果 `replication-type` 设置为 `regional-pd`,会制备一个 [区域性持久化磁盘(Regional Persistent Disk)](https://cloud.google.com/compute/docs/disks/#repds)。 -在这种情况下,用户必须使用 `zones` 而非 `zone` 来指定期望的复制区域(zone)。 -如果指定来两个特定的区域,区域性持久化磁盘会在这两个区域里制备。 -如果指定了多于两个的区域,Kubernetes 会选择其中任意两个区域。 -如果省略了 `zones` 参数,Kubernetes 会在集群管理的区域中任意选择。 + +强烈建议设置 `volumeBindingMode: WaitForFirstConsumer`,这样设置后, +当你创建一个 Pod,它使用的 PersistentVolumeClaim 使用了这个 StorageClass, +区域性持久化磁盘会在两个区域里制备。 其中一个区域是 Pod 所在区域。 +另一个区域是会在集群管理的区域中任意选择。磁盘区域可以通过 `allowedTopologies` 加以限制。 @@ -670,6 +674,44 @@ OpenStack 的内部驱动已经被弃用。请使用 ### vSphere + +vSphere 存储类有两种制备器 + +- [CSI 制备器](#csi-provisioner): `csi.vsphere.vmware.com` +- [vCP 制备器](#vcp-provisioner): `kubernetes.io/vsphere-volume` + +树内制备器已经被 +[弃用](/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi)。 +更多关于 CSI 制备器的详情,请参阅 +[Kubernetes vSphere CSI 驱动](https://vsphere-csi-driver.sigs.k8s.io/) +和 [vSphereVolume CSI 迁移](/docs/concepts/storage/volumes/#csi-migration-5)。 + + +#### CSI 制备器 {#vsphere-provisioner-csi} + +vSphere CSI StorageClass 制备器在 Tanzu Kubernetes 集群下运行。示例请参 +[vSphere CSI 仓库](https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/master/example/vanilla-k8s-file-driver/example-sc.yaml)。 + + +#### vCP 制备器 + +以下示例使用 VMware Cloud Provider (vCP) StorageClass 调度器 + @@ -1314,5 +1356,4 @@ scheduling constraints when choosing an appropriate PersistentVolume for a PersistentVolumeClaim. --> 延迟卷绑定使得调度器在为 PersistentVolumeClaim 选择一个合适的 -PersistentVolume 时能考虑到所有 Pod 的调度限制。 - +PersistentVolume 时能考虑到所有 Pod 的调度限制。 \ No newline at end of file