[zh] update content to match en master

pull/25683/head
jiajie 2020-12-17 16:44:52 +08:00 committed by jiaji
parent 839873d01d
commit fbbd5b4f75
1 changed files with 74 additions and 33 deletions

View File

@ -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 时会使用到。
<!--
The name of a StorageClass object is significant, and is how users can
@ -155,7 +156,7 @@ vendors provide their own external provisioner.
<!--
### Reclaim Policy
PersistentVolumes that are dynamically created by a storage class will have the
PersistentVolumes that are dynamically created by a StorageClass will have the
reclaim policy specified in the `reclaimPolicy` field of the class, which can be
either `Delete` or `Retain`. If no `reclaimPolicy` is specified when a
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 `
allows the users to resize the volume by editing the corresponding PVC object.
The following types of volumes support volume expansion, when the underlying
Storage Class has the field `allowVolumeExpansion` set to true.
StorageClass has the field `allowVolumeExpansion` set to true.
-->
PersistentVolume 可以配置为可扩展。将此功能设置为 `true` 时,允许用户通过编辑相应的 PVC 对象来调整卷大小。
基础存储类`allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
下层 StorageClass `allowVolumeExpansion` 字段设置为 true 时,以下类型的卷支持卷扩展。
{{< table caption = "Table of Volume types and the version of Kubernetes they require" >}}
<!--
Volume type | Required Kubernetes version
-->
| 卷类型 | 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)。
<!--
The following plugins support `WaitForFirstConsumer` with dynamic provisioning:
@ -299,7 +300,7 @@ The following plugins support `WaitForFirstConsumer` with pre-created Persistent
* 上述全部
* [Local](#local)
{{< feature-state state="beta" for_k8s_version="1.17" >}}
{{< feature-state state="stable" for_k8s_version="v1.17" >}}
<!--
[CSI volumes](/docs/concepts/storage/volumes/#csi) are also supported with dynamic provisioning
@ -352,7 +353,7 @@ allowedTopologies:
<!--
## Parameters
Storage classes have parameters that describe volumes belonging to the storage
Storage Classes have parameters that describe volumes belonging to the storage
class. Different parameters may be accepted depending on the `provisioner`. For
example, the value `io1`, for the parameter `type`, and the parameter
`iopsPerGB` are specific to EBS. When a parameter is omitted, some default is
@ -364,7 +365,7 @@ exceed 256 KiB.
-->
## 参数
Storage class 具有描述属于卷的参数。取决于制备器,可以接受不同的参数。
Storage Classes 的参数描述了存储类的卷。取决于制备器,可以接受不同的参数。
例如,参数 type 的值 io1 和参数 iopsPerGB 特定于 EBS PV。
当参数被省略时,会使用默认值。
@ -387,7 +388,7 @@ parameters:
<!--
* `type`: `io1`, `gp2`, `sc1`, `st1`. See
[AWS docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
[AWS docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
for details. Default: `gp2`.
* `zone` (Deprecated): AWS zone. If neither `zone` nor `zones` is specified, volumes are
generally round-robin-ed across all active zones where Kubernetes cluster
@ -399,7 +400,7 @@ parameters:
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS
volume plugin multiplies this with size of requested volume to compute IOPS
of the volume and caps it at 20 000 IOPS (maximum supported by AWS, see
[AWS docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
[AWS docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
A string is expected here, i.e. `"10"`, not `10`.
* `fsType`: fsType that is supported by kubernetes. Default: `"ext4"`.
* `encrypted`: denotes whether the EBS volume should be encrypted or not.
@ -446,6 +447,7 @@ metadata:
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
fstype: ext4
replication-type: none
```
@ -479,19 +481,21 @@ If `replication-type` is set to `none`, a regular (zonal) PD will be provisioned
<!--
If `replication-type` is set to `regional-pd`, a
[Regional Persistent Disk](https://cloud.google.com/compute/docs/disks/#repds)
will be provisioned. In this case, users must use `zones` instead of `zone` to
specify the desired replication zones. If exactly two zones are specified, the
Regional PD will be provisioned in those zones. If more than two zones are
specified, Kubernetes will arbitrarily choose among the specified zones. If the
`zones` parameter is omitted, Kubernetes will arbitrarily choose among zones
managed by the cluster.
will be provisioned. It's highly recommended to have
`volumeBindingMode: WaitForFirstConsumer` set, in which case when you create
a Pod that consumes a PersistentVolumeClaim which uses this StorageClass, a
Regional Persistent Disk is provisioned with two zones. One zone is the same
as the zone that the Pod is scheduled in. The other zone is randomly picked
from the zones available to the cluster. Disk zones can be further constrained
using `allowedTopologies`.
-->
如果 `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` 加以限制。
<!--
`zone` and `zones` parameters are deprecated and replaced with
@ -555,7 +559,7 @@ parameters:
contains user password to use when talking to Gluster REST service. These
parameters are optional, empty password will be used when both
`secretNamespace` and `secretName` are omitted. The provided secret must have
type `"kubernetes.io/glusterfs"`, e.g. created in this way:
type `"kubernetes.io/glusterfs"`, for example created in this way:
```
kubectl create secret generic heketi-secret \
@ -586,7 +590,7 @@ parameters:
`"8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"`. This
is an optional parameter.
* `gidMin`, `gidMax` : The minimum and maximum value of GID range for the
storage class. A unique value (GID) in this range ( gidMin-gidMax ) will be
StorageClass. A unique value (GID) in this range ( gidMin-gidMax ) will be
used for dynamically provisioned volumes. These are optional values. If not
specified, the volume will be provisioned with a value between 2000-2147483647
which are defaults for gidMin and gidMax respectively.
@ -594,7 +598,7 @@ parameters:
* `clusterid``630372ccdc720a92c681fb928f27b53f` 是集群的 ID当制备卷时
Heketi 将会使用这个文件。它也可以是一个 clusterid 列表,例如:
`"8452344e2becec931ece4e33c4674e4e,42982310de6c63381718ccfa6d8cf397"`。这个是可选参数。
* `gidMin``gidMax`storage class GID 范围的最小值和最大值。
* `gidMin``gidMax`StorageClass GID 范围的最小值和最大值。
在此范围gidMin-gidMax内的唯一值GID将用于动态制备卷。这些是可选的值。
如果不指定,所制备的卷为一个 2000-2147483647 之间的值,这是 gidMin 和
gidMax 的默认值。
@ -658,7 +662,7 @@ parameters:
<!--
{{< note >}}
{{< feature-state state="deprecated" for_k8s_version="1.11" >}}
{{< feature-state state="deprecated" for_k8s_version="v1.11" >}}
This internal provisioner of OpenStack is deprecated. Please use [the external cloud provider for OpenStack](https://github.com/kubernetes/cloud-provider-openstack).
{{< /note >}}
-->
@ -670,6 +674,44 @@ OpenStack 的内部驱动已经被弃用。请使用
### vSphere
<!--
There are two types of provisioners for vSphere storage classes:
- [CSI provisioner](#csi-provisioner): `csi.vsphere.vmware.com`
- [vCP provisioner](#vcp-provisioner): `kubernetes.io/vsphere-volume`
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).
-->
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 Provisioner {#vsphere-provisioner-csi}
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).
-->
#### 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 Provisioner
The following examples use the VMware Cloud Provider (vCP) StorageClass provisioner.
-->
#### vCP 制备器
以下示例使用 VMware Cloud Provider (vCP) StorageClass 调度器
<!--
1. Create a StorageClass with a user specified disk format.
-->
@ -1314,5 +1356,4 @@ scheduling constraints when choosing an appropriate PersistentVolume for a
PersistentVolumeClaim.
-->
延迟卷绑定使得调度器在为 PersistentVolumeClaim 选择一个合适的
PersistentVolume 时能考虑到所有 Pod 的调度限制。
PersistentVolume 时能考虑到所有 Pod 的调度限制。