Merge pull request #6417 from msau42/storage-class-best-practices

Update storage class recommendations with GA fields
pull/6467/head
Qiming 2017-11-28 10:04:16 +08:00 committed by GitHub
commit edcb39d46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 18 deletions

View File

@ -428,28 +428,18 @@ and need persistent storage, we recommend that you use the following pattern:
the config may not have permission to create PersistentVolumes. the config may not have permission to create PersistentVolumes.
- Give the user the option of providing a storage class name when instantiating - Give the user the option of providing a storage class name when instantiating
the template. the template.
- If the user provides a storage class name, and the cluster is version 1.4 - If the user provides a storage class name, put that value into the
or newer, put that value into the `volume.beta.kubernetes.io/storage-class` `persistentVolumeClaim.storageClassName` field.
annotation of the PVC. This will cause the PVC to match the right storage This will cause the PVC to match the right storage
class if the cluster has StorageClasses enabled by the admin. class if the cluster has StorageClasses enabled by the admin.
- If the user does not provide a storage class name or the cluster is version - If the user does not provide a storage class name, leave the
1.3, then instead put a `volume.alpha.kubernetes.io/storage-class: default` `persistentVolumeClaim.storageClassName` field as nil.
annotation on the PVC.
- This will cause a PV to be automatically provisioned for the user with - This will cause a PV to be automatically provisioned for the user with
sane default characteristics on some clusters. the default StorageClass in the cluster. Many cluster environments have
- Despite the word `alpha` in the name, the code behind this annotation has a default StorageClass installed, or administrators can create their own
`beta` level support. default StorageClass.
- Do not use `volume.beta.kubernetes.io/storage-class:` with any value
including the empty string since it will prevent `DefaultStorageClass`
admission controller from running if enabled.
- In your tooling, do watch for PVCs that are not getting bound after some time - In your tooling, do watch for PVCs that are not getting bound after some time
and surface this to the user, as this may indicate that the cluster has no and surface this to the user, as this may indicate that the cluster has no
dynamic storage support (in which case the user should create a matching PV) dynamic storage support (in which case the user should create a matching PV)
or the cluster has no storage system (in which case the user cannot deploy or the cluster has no storage system (in which case the user cannot deploy
config requiring PVCs). config requiring PVCs).
- In the future, we expect most clusters to have `DefaultStorageClass` enabled,
and to have some form of storage available. However, there may not be any
storage class names which work on all clusters, so continue to not set one by
default.
At some point, the alpha annotation will cease to have meaning, but the unset
`storageClass` field on the PVC will have the desired effect.