From 91d0988afbafd548bce9e4af5c5cb3d22f326046 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 19 Aug 2016 15:35:35 -0400 Subject: [PATCH 01/11] Add section on storage classes to PV doc --- docs/user-guide/persistent-volumes/index.md | 116 ++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index fdfba107e8..53eeacecb8 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -20,6 +20,19 @@ A `PersistentVolume` (PV) is a piece of networked storage in the cluster that ha A `PersistentVolumeClaim` (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g, can be mounted once read/write or many times read-only). +Administrators often need to offer and provision a variety of +`PersistentVolumes` that differ in more ways than just size and access modes, +and users should be able to choose from the offered volumes without having to +understand their technical properties. For these needs there is the +`StorageClass` resource. + +A `StorageClass` provides a way for administrators to describe the "classes" of + storage they offer. Different classes might map to quality-of-service levels, +or to backup policies, or to arbitrary policies determined by the cluster +administrators. Kubernetes itself is unopinionated about what classes +represent. This concept is sometimes called "profiles" in other storage +systems. + Please see the [detailed walkthrough with working examples](/docs/user-guide/persistent-volumes/walkthrough/). @@ -216,3 +229,106 @@ spec: ### A Note on Namespaces `PersistentVolumes` binds are exclusive, and since `PersistentVolumeClaims` are namespaced objects, mounting claims with "Many" modes (`ROX`, `RWX`) is only possible within one namespace. + +## StorageClasses + +Each `StorageClass` contains the fields `provisioner` and `parameters`, which +are used when a `PersistentVolume` belonging to a class needs to be dynamically + provisioned. + +The name of a `StorageClass` object is significant, and is how users can +request a particular class. Administrators set the name and other parameters +of a class, all of which are opaque to users, when first creating +`StorageClass` objects, and the objects cannot be updated once they are +created. + +```yaml +kind: StorageClass +apiVersion: extensions/v1beta1 +metadata: + name: standard +provisioner: kubernetes.io/aws-ebs +parameters: + type: gp2 +``` + +### Provisioner +Storage classes have a provisioner that determines what volume plugin is used +for provisioning PVs. This field must be specified. The available provisioner +types are `kubernetes.io/aws-ebs` and `kubernetes.io/gce-pd`. + +### Parameters +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 +used. + +#### AWS + +```yaml +kind: StorageClass +apiVersion: extensions/v1beta1 +metadata: + name: slow +provisioner: kubernetes.io/aws-ebs +parameters: + type: io1 + zone: us-east-1d + iopsPerGB: "10" +``` + +* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. +* `zone`: AWS zone. If not specified, a random zone in the same region as +controller-manager will be chosen. +* `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). + +#### GCE + +```yaml +kind: StorageClass +apiVersion: extensions/v1beta1 +metadata: + name: slow +provisionerType: kubernetes.io/gce-pd +provisionerParameters: + type: pd-standard + zone: us-central1-a +``` + +* `type`: `pd-standard` or `pd-ssd`. Default: `pd-ssd` +* `zone`: GCE zone. If not specified, a random zone in the same region as +controller-manager will be chosen. + +## Requesting a StorageClass + +Users request a particular `StorageClass`, i.e. a `PersistentVolume` that +belongs to and has the characteristics described by the `StorageClass`, by +specifying the name of the class in their `PersistentVolumeClaim` using the +annotation `volume.beta.kubernetes.io/storage-class`. Only a PV of the +requested class, one with the same annotation as the PVC, can then be bound to +the PVC. + +```yaml +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: myclaim + annotations: + "volume.beta.kubernetes.io/storage-class": "slow" +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +``` + +If a PV of the requested class is not found, a new one will be provisioned +using the `StorageClass`. + +When a PVC specifies a `LabelSelector` in addition to requesting a +`StorageClass`, the requirements are ANDed together: only a PV of the requested + class and with the requested labels may be bound to the PVC. From 0c5b27f2e62c0413dbcb8fcc8f9cb8d22e9a85d1 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 19 Aug 2016 17:59:45 -0400 Subject: [PATCH 02/11] Intro --- docs/user-guide/persistent-volumes/index.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 53eeacecb8..5270b0be80 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -20,11 +20,13 @@ A `PersistentVolume` (PV) is a piece of networked storage in the cluster that ha A `PersistentVolumeClaim` (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g, can be mounted once read/write or many times read-only). -Administrators often need to offer and provision a variety of -`PersistentVolumes` that differ in more ways than just size and access modes, -and users should be able to choose from the offered volumes without having to -understand their technical properties. For these needs there is the -`StorageClass` resource. +While `PersistentVolumeClaims` allow a user to consume abstract storage +resources, it is common that users need `PersistentVolumes` with varying +properties, such as performance, for different problems. Cluster administrators +need to be able to offer a variety of `PersistentVolumes` that differ in more +ways than just size and access modes, without exposing users to the details of +how those volumes are implemented. For these needs there is the `StorageClass` +resource. A `StorageClass` provides a way for administrators to describe the "classes" of storage they offer. Different classes might map to quality-of-service levels, @@ -254,8 +256,8 @@ parameters: ### Provisioner Storage classes have a provisioner that determines what volume plugin is used -for provisioning PVs. This field must be specified. The available provisioner -types are `kubernetes.io/aws-ebs` and `kubernetes.io/gce-pd`. +for provisioning PVs. This field must be specified. During beta, the available +provisioner types are `kubernetes.io/aws-ebs` and `kubernetes.io/gce-pd`. ### Parameters Storage classes have parameters that describe volumes belonging to the storage From d70418625edb41586f865d55ab2100e7b5135ed0 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 19 Aug 2016 19:07:08 -0400 Subject: [PATCH 03/11] default behaviour bit --- docs/user-guide/persistent-volumes/index.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 5270b0be80..e18eb769b2 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -244,6 +244,22 @@ of a class, all of which are opaque to users, when first creating `StorageClass` objects, and the objects cannot be updated once they are created. +Users don't necessarily have to request a `StorageClass` in their PVC. The +cluster treats PVCs that don't request a `StorageClass` differently depending +on whether the +[`SimpleDefaultStorageClassForPVC` admission controller](docs/admin/admission-controllers/#simpledefaultstorageclassforpvc) is turned on. +* If the admission controller is turned on, the administrator may specify a +default `StorageClass`. All PVCs that don't request a `StorageClass` will be +bound only to PVs of that default. Specifying a default `StorageClass` is done +by setting the annotation `storageclass.beta.kubernetes.io/is-default-class` +equal to "true" in a `StorageClass` object. If the administrator does not +specify a default, the cluster will respond to PVC creation as if the admission +controller were turned off. If more than one default is specified, the +admission controller will forbid the creation of all PVCs. +* If the admission controller is turned off, the claim may be bound to any +volume that does not belong to a `StorageClass` or that has a blank `""` value +for its `volume.beta.kubernetes.io/storage-class` annotation. + ```yaml kind: StorageClass apiVersion: extensions/v1beta1 From 676a4f1577320a7f075e3dd4767827b3f1597b52 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Mon, 22 Aug 2016 23:34:32 -0400 Subject: [PATCH 04/11] add class sections --- docs/user-guide/persistent-volumes/index.md | 98 +++++++++++---------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index e18eb769b2..c97869aac2 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -93,6 +93,8 @@ Each PV contains a spec and status, which is the specification and status of the kind: PersistentVolume metadata: name: pv0003 + annotations: + volume.beta.kubernetes.io/storage-class: "slow" spec: capacity: storage: 5Gi @@ -145,6 +147,16 @@ In the CLI, the access modes are abbreviated to: | RDB | x | x | - | | VsphereVolume | x | - | - | +### Class + +A PV can have a class, which is specified by setting the +"volume.beta.kubernetes.io/storage-class" annotation to the name of a +`StorageClass`. A PV of a particular class can only be bound to PVCs requesting +that class. A PV with no annotation or its class annotation set to `""` has no +class and can only be bound to PVCs that request no particular class. + +In the future after beta, the `volume.beta.kubernetes.io/storage-class` +annotation will become an attribute. ### Recycling Policy @@ -176,6 +188,8 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: myclaim + annotations: + volume.beta.kubernetes.io/storage-class: "slow" spec: accessModes: - ReadWriteOnce @@ -206,6 +220,36 @@ Claims can specify a [label selector](/docs/user-guide/labels/#label-selectors) All of the requirements, from both `matchLabels` and `matchExpressions` are ANDed together – they must all be satisfied in order to match. +### Class + +A claim can request a particular class by specifying the name of a +`StorageClass`using the annotation `volume.beta.kubernetes.io/storage-class`. +Only PVs of the requested class, ones with the same annotation as the PVC, can +be bound to the PVC. + +PVCs don't necessarily have to request a class, they can omit the annotation or +set it to `""`. The cluster treats PVCs that don't request a class differently +depending on whether the +[`SimpleDefaultStorageClassForPVC` admission controller](docs/admin/admission-controllers/#simpledefaultstorageclassforpvc) +is turned on. + +* If the admission controller is turned on, the administrator may specify a +default `StorageClass`. All PVCs that don't request a `StorageClass` can be +bound only to PVs of that default. This means that the PVs those PVCs would +normally be bound to, the PVs that have no class (no annotation or annotation +equal to `""`), cannot be bound to any PVC. Specifying a default `StorageClass` +is done by setting the annotation +`storageclass.beta.kubernetes.io/is-default-class` equal to "true" in a +`StorageClass` object. If the administrator does not specify a default, the +cluster will respond to PVC creation as if the admission controller were turned +off. If more than one default is specified, the admission controller will forbid +the creation of all PVCs. +* If the admission controller is turned off, the claim may be bound to volumes +that have no class + +In the future after beta, the `volume.beta.kubernetes.io/storage-class` +annotation will become an attribute. + ## Claims As Volumes Pods access storage by using the claim as a volume. Claims must exist in the same namespace as the pod using the claim. The cluster finds the claim in the pod's namespace and uses it to get the `PersistentVolume` backing the claim. The volume is then mounted to the host and into the pod. @@ -244,21 +288,10 @@ of a class, all of which are opaque to users, when first creating `StorageClass` objects, and the objects cannot be updated once they are created. -Users don't necessarily have to request a `StorageClass` in their PVC. The -cluster treats PVCs that don't request a `StorageClass` differently depending -on whether the -[`SimpleDefaultStorageClassForPVC` admission controller](docs/admin/admission-controllers/#simpledefaultstorageclassforpvc) is turned on. -* If the admission controller is turned on, the administrator may specify a -default `StorageClass`. All PVCs that don't request a `StorageClass` will be -bound only to PVs of that default. Specifying a default `StorageClass` is done -by setting the annotation `storageclass.beta.kubernetes.io/is-default-class` -equal to "true" in a `StorageClass` object. If the administrator does not -specify a default, the cluster will respond to PVC creation as if the admission -controller were turned off. If more than one default is specified, the -admission controller will forbid the creation of all PVCs. -* If the admission controller is turned off, the claim may be bound to any -volume that does not belong to a `StorageClass` or that has a blank `""` value -for its `volume.beta.kubernetes.io/storage-class` annotation. +Administrators can specify a default `StorageClass` just for PVCs that don't +request any particular class to bind to: see the +[`PersistentVolumeClaim` section](docs/user-guide/persistent-volumes/index/#class-1) +for details. ```yaml kind: StorageClass @@ -297,8 +330,8 @@ parameters: ``` * `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. -* `zone`: AWS zone. If not specified, a random zone in the same region as -controller-manager will be chosen. +* `zone`: AWS zone. If not specified, a random zone where the cluster has a node +is chosen * `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). @@ -319,34 +352,3 @@ provisionerParameters: * `type`: `pd-standard` or `pd-ssd`. Default: `pd-ssd` * `zone`: GCE zone. If not specified, a random zone in the same region as controller-manager will be chosen. - -## Requesting a StorageClass - -Users request a particular `StorageClass`, i.e. a `PersistentVolume` that -belongs to and has the characteristics described by the `StorageClass`, by -specifying the name of the class in their `PersistentVolumeClaim` using the -annotation `volume.beta.kubernetes.io/storage-class`. Only a PV of the -requested class, one with the same annotation as the PVC, can then be bound to -the PVC. - -```yaml -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: myclaim - annotations: - "volume.beta.kubernetes.io/storage-class": "slow" -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi -``` - -If a PV of the requested class is not found, a new one will be provisioned -using the `StorageClass`. - -When a PVC specifies a `LabelSelector` in addition to requesting a -`StorageClass`, the requirements are ANDed together: only a PV of the requested - class and with the requested labels may be bound to the PVC. From 12c3921fc951a05f417bfcf54a3285b1907b2c07 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 00:01:16 -0400 Subject: [PATCH 05/11] if ac turned off description --- docs/user-guide/persistent-volumes/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index c97869aac2..959cabf0ab 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -244,8 +244,9 @@ is done by setting the annotation cluster will respond to PVC creation as if the admission controller were turned off. If more than one default is specified, the admission controller will forbid the creation of all PVCs. -* If the admission controller is turned off, the claim may be bound to volumes -that have no class +* If the admission controller is turned off, there is no notion of a default +`StorageClass`. All PVCs that don't request a `StorageClass` can be bound only +to PVs that have no class. In the future after beta, the `volume.beta.kubernetes.io/storage-class` annotation will become an attribute. From edbac93ea81637ba9924ce9cf015dd5dfaccaa83 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 00:19:02 -0400 Subject: [PATCH 06/11] make admission controller bit clearer --- docs/user-guide/persistent-volumes/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 959cabf0ab..974274325c 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -150,7 +150,7 @@ In the CLI, the access modes are abbreviated to: ### Class A PV can have a class, which is specified by setting the -"volume.beta.kubernetes.io/storage-class" annotation to the name of a +`volume.beta.kubernetes.io/storage-class` annotation to the name of a `StorageClass`. A PV of a particular class can only be bound to PVCs requesting that class. A PV with no annotation or its class annotation set to `""` has no class and can only be bound to PVCs that request no particular class. @@ -235,15 +235,15 @@ is turned on. * If the admission controller is turned on, the administrator may specify a default `StorageClass`. All PVCs that don't request a `StorageClass` can be -bound only to PVs of that default. This means that the PVs those PVCs would -normally be bound to, the PVs that have no class (no annotation or annotation -equal to `""`), cannot be bound to any PVC. Specifying a default `StorageClass` -is done by setting the annotation +bound only to PVs of that default. A consequence of this is that the PVs those +PVCs would normally be bound to, the PVs that have no class (no annotation or annotation +equal to `""`), are unable to be bound to any PVC. Specifying a default +`StorageClass` is done by setting the annotation `storageclass.beta.kubernetes.io/is-default-class` equal to "true" in a `StorageClass` object. If the administrator does not specify a default, the -cluster will respond to PVC creation as if the admission controller were turned -off. If more than one default is specified, the admission controller will forbid -the creation of all PVCs. +cluster responds to PVC creation as if the admission controller were turned off. +If more than one default is specified, the admission controller forbids the +creation of all PVCs. * If the admission controller is turned off, there is no notion of a default `StorageClass`. All PVCs that don't request a `StorageClass` can be bound only to PVs that have no class. From 4e486e97b6eaa0cbcdd2c136166f916b55d0e71b Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 07:41:32 -0400 Subject: [PATCH 07/11] fix admission controller bit --- docs/user-guide/persistent-volumes/index.md | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 974274325c..1c34490a92 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -227,26 +227,26 @@ A claim can request a particular class by specifying the name of a Only PVs of the requested class, ones with the same annotation as the PVC, can be bound to the PVC. -PVCs don't necessarily have to request a class, they can omit the annotation or -set it to `""`. The cluster treats PVCs that don't request a class differently -depending on whether the +PVCs don't necessarily have to request a class. A PVC with its annotation set +equal to `""` is always interpreted to be requesting a PV with no class, so it +can only be bound to PVs with no class (no annotation or one set equal to +`""`). A PVC with no annotation is not quite the same and is treated differently +by the cluster depending on whether the [`SimpleDefaultStorageClassForPVC` admission controller](docs/admin/admission-controllers/#simpledefaultstorageclassforpvc) is turned on. * If the admission controller is turned on, the administrator may specify a -default `StorageClass`. All PVCs that don't request a `StorageClass` can be -bound only to PVs of that default. A consequence of this is that the PVs those -PVCs would normally be bound to, the PVs that have no class (no annotation or annotation -equal to `""`), are unable to be bound to any PVC. Specifying a default -`StorageClass` is done by setting the annotation -`storageclass.beta.kubernetes.io/is-default-class` equal to "true" in a -`StorageClass` object. If the administrator does not specify a default, the +default `StorageClass`. All PVCs that have no annotation can be bound only to +PVs of that default. Specifying a default `StorageClass` is done by setting the +annotation `storageclass.beta.kubernetes.io/is-default-class` equal to "true" in +a `StorageClass` object. If the administrator does not specify a default, the cluster responds to PVC creation as if the admission controller were turned off. If more than one default is specified, the admission controller forbids the creation of all PVCs. * If the admission controller is turned off, there is no notion of a default -`StorageClass`. All PVCs that don't request a `StorageClass` can be bound only -to PVs that have no class. +`StorageClass`. All PVCs that have no annotation can be bound only to PVs that +have no class. In this case the PVCs that have no annotation are treated the +same way as PVCs that have their annotation set to `""`. In the future after beta, the `volume.beta.kubernetes.io/storage-class` annotation will become an attribute. From 3e0e58bf16c61acab8fae3c8f335e3e1aa2165c3 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 19:07:14 -0400 Subject: [PATCH 08/11] dynamic provisioning in lifecycle section --- docs/user-guide/persistent-volumes/index.md | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 1c34490a92..a2b8076212 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -44,11 +44,21 @@ PVs are resources in the cluster. PVCs are requests for those resources and als ### Provisioning -A cluster administrator will create a number of PVs. They carry the details of the real storage which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption. +There are two ways PVs may be provisioned: statically or dynamically. + +#### Static +A cluster administrator creates a number of PVs. They carry the details of the real storage which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption. + +#### Dynamic +A cluster administrator creates a number of `StorageClasses`. They describe "classes" of PVs that cluster users may request. They contain the information that the cluster needs in order to dynamically create PVs in response to user requests. + +A user creates a `PersistentVolumeClaim` that requests one of the `StorageClasses` the administrator created. A PV that exactly matches the requests of the PVC is automatically created specially for the user's PVC using the information contained in the requested `StorageClass`. + +Claims that request the class `""` effectively disable dynamic provisioning for themselves. ### Binding -A user creates a `PersistentVolumeClaim` with a specific amount of storage requested and with certain access modes. A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together. The user will always get at least what they asked for, but the volume may be in excess of what was requested. Once bound, `PersistentVolumeClaim` binds are exclusive, regardless of the mode used to bind them. +A user creates, or has already created in the case of dynamic provisioning, a `PersistentVolumeClaim` with a specific amount of storage requested and with certain access modes. A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together. If a PV was dynamically provisioned for a new PVC, the loop will always bind that PV to the PVC. Otherwise, the user will always get at least what they asked for, but the volume may be in excess of what was requested. Once bound, `PersistentVolumeClaim` binds are exclusive, regardless of the mode used to bind them. Claims will remain unbound indefinitely if a matching volume does not exist. Claims will be bound as matching volumes become available. For example, a cluster provisioned with many 50Gi PVs would not match a PVC requesting 100Gi. The PVC can be bound when a 100Gi PV is added to the cluster. @@ -248,6 +258,10 @@ creation of all PVCs. have no class. In this case the PVCs that have no annotation are treated the same way as PVCs that have their annotation set to `""`. +When a PVC specifies a `selector` in addition to requesting a `StorageClass`, +the requirements are ANDed together: only a PV of the requested class and with +the requested labels may be bound to the PVC. + In the future after beta, the `volume.beta.kubernetes.io/storage-class` annotation will become an attribute. @@ -280,8 +294,8 @@ spec: ## StorageClasses Each `StorageClass` contains the fields `provisioner` and `parameters`, which -are used when a `PersistentVolume` belonging to a class needs to be dynamically - provisioned. +are used when a `PersistentVolume` belonging to the class needs to be +dynamically provisioned. The name of a `StorageClass` object is significant, and is how users can request a particular class. Administrators set the name and other parameters From 8593aa43f8fea0e52920bc8ddeacfff50e726f41 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 19:16:22 -0400 Subject: [PATCH 09/11] trailing whitespace --- docs/user-guide/persistent-volumes/index.md | 42 ++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index a2b8076212..6f3e5c1ff2 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -29,10 +29,10 @@ how those volumes are implemented. For these needs there is the `StorageClass` resource. A `StorageClass` provides a way for administrators to describe the "classes" of - storage they offer. Different classes might map to quality-of-service levels, -or to backup policies, or to arbitrary policies determined by the cluster -administrators. Kubernetes itself is unopinionated about what classes -represent. This concept is sometimes called "profiles" in other storage +storage they offer. Different classes might map to quality-of-service levels, +or to backup policies, or to arbitrary policies determined by the cluster +administrators. Kubernetes itself is unopinionated about what classes +represent. This concept is sometimes called "profiles" in other storage systems. Please see the [detailed walkthrough with working examples](/docs/user-guide/persistent-volumes/walkthrough/). @@ -44,7 +44,7 @@ PVs are resources in the cluster. PVCs are requests for those resources and als ### Provisioning -There are two ways PVs may be provisioned: statically or dynamically. +There are two ways PVs may be provisioned: statically or dynamically. #### Static A cluster administrator creates a number of PVs. They carry the details of the real storage which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption. @@ -165,7 +165,7 @@ A PV can have a class, which is specified by setting the that class. A PV with no annotation or its class annotation set to `""` has no class and can only be bound to PVCs that request no particular class. -In the future after beta, the `volume.beta.kubernetes.io/storage-class` +In the future after beta, the `volume.beta.kubernetes.io/storage-class` annotation will become an attribute. ### Recycling Policy @@ -262,7 +262,7 @@ When a PVC specifies a `selector` in addition to requesting a `StorageClass`, the requirements are ANDed together: only a PV of the requested class and with the requested labels may be bound to the PVC. -In the future after beta, the `volume.beta.kubernetes.io/storage-class` +In the future after beta, the `volume.beta.kubernetes.io/storage-class` annotation will become an attribute. ## Claims As Volumes @@ -293,19 +293,19 @@ spec: ## StorageClasses -Each `StorageClass` contains the fields `provisioner` and `parameters`, which +Each `StorageClass` contains the fields `provisioner` and `parameters`, which are used when a `PersistentVolume` belonging to the class needs to be dynamically provisioned. -The name of a `StorageClass` object is significant, and is how users can -request a particular class. Administrators set the name and other parameters -of a class, all of which are opaque to users, when first creating -`StorageClass` objects, and the objects cannot be updated once they are +The name of a `StorageClass` object is significant, and is how users can +request a particular class. Administrators set the name and other parameters +of a class, all of which are opaque to users, when first creating +`StorageClass` objects, and the objects cannot be updated once they are created. Administrators can specify a default `StorageClass` just for PVCs that don't request any particular class to bind to: see the -[`PersistentVolumeClaim` section](docs/user-guide/persistent-volumes/index/#class-1) +[`PersistentVolumeClaim` section](docs/user-guide/persistent-volumes/#class-1) for details. ```yaml @@ -319,15 +319,15 @@ parameters: ``` ### Provisioner -Storage classes have a provisioner that determines what volume plugin is used +Storage classes have a provisioner that determines what volume plugin is used for provisioning PVs. This field must be specified. During beta, the available provisioner types are `kubernetes.io/aws-ebs` and `kubernetes.io/gce-pd`. ### 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 + example, the value `io1`, for the parameter `type`, and the parameter +`iopsPerGB` are specific to EBS. When a parameter is omitted, some default is used. #### AWS @@ -344,11 +344,11 @@ parameters: iopsPerGB: "10" ``` -* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. +* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. * `zone`: AWS zone. If not specified, a random zone where the cluster has a node is chosen -* `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 +* `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). #### GCE @@ -365,5 +365,5 @@ provisionerParameters: ``` * `type`: `pd-standard` or `pd-ssd`. Default: `pd-ssd` -* `zone`: GCE zone. If not specified, a random zone in the same region as +* `zone`: GCE zone. If not specified, a random zone in the same region as controller-manager will be chosen. From 1c8bc666ab08c4d6b06b7bb4d6a671dceca5290c Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 23 Aug 2016 19:39:13 -0400 Subject: [PATCH 10/11] copy latest paremeters section from examples readme --- docs/user-guide/persistent-volumes/index.md | 54 +++++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index 6f3e5c1ff2..ab5ebb1c8e 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -345,11 +345,10 @@ parameters: ``` * `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. -* `zone`: AWS zone. If not specified, a random zone where the cluster has a node -is chosen -* `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). +* `zone`: AWS zone. If not specified, a random zone from those where Kubernetes cluster has a node is chosen. +* `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). +* `encrypted`: denotes whether the EBS volume should be encrypted or not. Valid values are `true` or `false`. +* `kmsKeyId`: optional. The full Amazon Resource Name of the key to use when encrypting the volume. If none is supplied but `encrypted` is true, a key is generated by AWS. See AWS docs for valid ARN value. #### GCE @@ -358,12 +357,49 @@ kind: StorageClass apiVersion: extensions/v1beta1 metadata: name: slow -provisionerType: kubernetes.io/gce-pd -provisionerParameters: +provisioner: kubernetes.io/gce-pd +parameters: type: pd-standard zone: us-central1-a ``` * `type`: `pd-standard` or `pd-ssd`. Default: `pd-ssd` -* `zone`: GCE zone. If not specified, a random zone in the same region as -controller-manager will be chosen. +* `zone`: GCE zone. If not specified, a random zone in the same region as controller-manager will be chosen. + +#### GLUSTERFS + +```yaml +apiVersion: extensions/v1beta1 +kind: StorageClass +metadata: + name: slow +provisioner: kubernetes.io/glusterfs +parameters: + endpoint: "glusterfs-cluster" + resturl: "http://127.0.0.1:8081" + restauthenabled: "true" + restuser: "admin" + restuserkey: "password" +``` + +* `endpoint`: `glusterfs-cluster` is the endpoint/service name which includes GlusterFS trusted pool IP addresses and this parameter is mandatory. +* `resturl` : Gluster REST service url which provision gluster volumes on demand. The format should be `IPaddress:Port` and this is a mandatory parameter for GlusterFS dynamic provisioner. +* `restauthenabled` : Gluster REST service authentication boolean is required if the authentication is enabled on the REST server. If this value is 'true', 'restuser' and 'restuserkey' have to be filled. +* `restuser` : Gluster REST service user who has access to create volumes in the Gluster Trusted Pool. +* `restuserkey` : Gluster REST service user's password which will be used for authentication to the REST server. + +#### OpenStack Cinder + +```yaml +kind: StorageClass +apiVersion: extensions/v1beta1 +metadata: + name: gold +provisioner: kubernetes.io/cinder +parameters: + type: fast + availability: nova +``` + +* `type`: [VolumeType](http://docs.openstack.org/admin-guide/dashboard-manage-volumes.html) created in Cinder. Default is empty. +* `availability`: Availability Zone. Default is empty. From 8ecd91b349bda20b577348752dc8e2e39a866073 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 25 Aug 2016 13:30:09 -0400 Subject: [PATCH 11/11] more feedback --- docs/user-guide/persistent-volumes/index.md | 26 +++++++++------------ 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/user-guide/persistent-volumes/index.md b/docs/user-guide/persistent-volumes/index.md index ab5ebb1c8e..32ac8fbd00 100644 --- a/docs/user-guide/persistent-volumes/index.md +++ b/docs/user-guide/persistent-volumes/index.md @@ -50,11 +50,7 @@ There are two ways PVs may be provisioned: statically or dynamically. A cluster administrator creates a number of PVs. They carry the details of the real storage which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption. #### Dynamic -A cluster administrator creates a number of `StorageClasses`. They describe "classes" of PVs that cluster users may request. They contain the information that the cluster needs in order to dynamically create PVs in response to user requests. - -A user creates a `PersistentVolumeClaim` that requests one of the `StorageClasses` the administrator created. A PV that exactly matches the requests of the PVC is automatically created specially for the user's PVC using the information contained in the requested `StorageClass`. - -Claims that request the class `""` effectively disable dynamic provisioning for themselves. +When none of the static PVs the administrator created matches a user's `PersistentVolumeClaim`, the cluster may try to dynamically provision a volume specially for the PVC. This provisioning is based on `StorageClasses`: the PVC must request a class and the administrator must have created and configured that class in order for dynamic provisioning to occur. Claims that request the class `""` effectively disable dynamic provisioning for themselves. ### Binding @@ -74,7 +70,7 @@ When a user is done with their volume, they can delete the PVC objects from the ### Reclaiming -The reclaim policy for a `PersistentVolume` tells the cluster what to do with the volume after it has been released of its claim. Currently, volumes can either be Retained, Recycled or Deleted. Retention allows for manual reclamation of the resource. For those volume plugins that support it, deletion removes both the `PersistentVolume` object from Kubernetes as well as deletes associated storage asset in external infrastructure such as AWS EBS, GCE PD or Cinder volume. If supported by appropriate volume plugin, recycling performs a basic scrub (`rm -rf /thevolume/*`) on the volume and makes it available again for a new claim. +The reclaim policy for a `PersistentVolume` tells the cluster what to do with the volume after it has been released of its claim. Currently, volumes can either be Retained, Recycled or Deleted. Retention allows for manual reclamation of the resource. For those volume plugins that support it, deletion removes both the `PersistentVolume` object from Kubernetes as well as deletes associated storage asset in external infrastructure such as AWS EBS, GCE PD or Cinder volume. Volumes that were dynamically provisioned are always deleted. If supported by appropriate volume plugin, recycling performs a basic scrub (`rm -rf /thevolume/*`) on the volume and makes it available again for a new claim. ## Types of Persistent Volumes @@ -242,18 +238,18 @@ equal to `""` is always interpreted to be requesting a PV with no class, so it can only be bound to PVs with no class (no annotation or one set equal to `""`). A PVC with no annotation is not quite the same and is treated differently by the cluster depending on whether the -[`SimpleDefaultStorageClassForPVC` admission controller](docs/admin/admission-controllers/#simpledefaultstorageclassforpvc) +[`DefaultStorageClass` admission plugin](docs/admin/admission-controllers/#defaultstorageclass) is turned on. -* If the admission controller is turned on, the administrator may specify a +* If the admission plugin is turned on, the administrator may specify a default `StorageClass`. All PVCs that have no annotation can be bound only to PVs of that default. Specifying a default `StorageClass` is done by setting the annotation `storageclass.beta.kubernetes.io/is-default-class` equal to "true" in a `StorageClass` object. If the administrator does not specify a default, the -cluster responds to PVC creation as if the admission controller were turned off. -If more than one default is specified, the admission controller forbids the -creation of all PVCs. -* If the admission controller is turned off, there is no notion of a default +cluster responds to PVC creation as if the admission plugin were turned off. If +more than one default is specified, the admission plugin forbids the creation of +all PVCs. +* If the admission plugin is turned off, there is no notion of a default `StorageClass`. All PVCs that have no annotation can be bound only to PVs that have no class. In this case the PVCs that have no annotation are treated the same way as PVCs that have their annotation set to `""`. @@ -344,10 +340,10 @@ parameters: iopsPerGB: "10" ``` -* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`. +* `type`: `io1`, `gp2`, `sc1`, `st1`. See [AWS docs](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) for details. Default: `gp2`. * `zone`: AWS zone. If not specified, a random zone from those where Kubernetes cluster has a node is chosen. -* `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). -* `encrypted`: denotes whether the EBS volume should be encrypted or not. Valid values are `true` or `false`. +* `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). A string is expected here, i.e. `"10"`, not `10`. +* `encrypted`: denotes whether the EBS volume should be encrypted or not. Valid values are `"true"` or `"false"`. A string is expected here, i.e. `"true"`, not `true`. * `kmsKeyId`: optional. The full Amazon Resource Name of the key to use when encrypting the volume. If none is supplied but `encrypted` is true, a key is generated by AWS. See AWS docs for valid ARN value. #### GCE