Commit dddf7bff authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #42637 from jsafrane/v1-examples

Automatic merge from submit-queue (batch tested with PRs 42637, 42648) Update examples with storage.k8s.io/v1 This should squeeze into 1.6. All changes are in `examples` directory and reflect our new API. Release note: ```release-note NONE ``` @kubernetes/sig-storage-pr-reviews
parents 55d500e6 02fbd8a0
...@@ -11,13 +11,15 @@ scripts that launch kube-controller-manager. ...@@ -11,13 +11,15 @@ scripts that launch kube-controller-manager.
The admin must define `StorageClass` objects that describe named "classes" of storage offered in a cluster. Different classes might map to arbitrary levels or policies determined by the admin. When configuring a `StorageClass` object for persistent volume provisioning, the admin will need to describe the type of provisioner to use and the parameters that will be used by the provisioner when it provisions a `PersistentVolume` belonging to the class. The admin must define `StorageClass` objects that describe named "classes" of storage offered in a cluster. Different classes might map to arbitrary levels or policies determined by the admin. When configuring a `StorageClass` object for persistent volume provisioning, the admin will need to describe the type of provisioner to use and the parameters that will be used by the provisioner when it provisions a `PersistentVolume` belonging to the class.
The name of a StorageClass object is significant, and is how users can request a particular class, by specifying the name in their `PersistentVolumeClaim`. The `provisioner` field must be specified as it determines what volume plugin is used for provisioning PVs. 2 cloud providers will be provided in the beta version of this feature: EBS and GCE. The `parameters` field contains the 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. The name of a StorageClass object is significant, and is how users can request a particular class, by specifying the name in their `PersistentVolumeClaim`. The `provisioner` field must be specified as it determines what volume plugin is used for provisioning PVs. The `parameters` field contains the 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.
See [Kubernetes StorageClass documentation](https://kubernetes.io/docs/user-guide/persistent-volumes/#storageclasses) for complete reference of all supported parameters.
#### AWS #### AWS
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/aws-ebs provisioner: kubernetes.io/aws-ebs
...@@ -37,7 +39,7 @@ parameters: ...@@ -37,7 +39,7 @@ parameters:
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/gce-pd provisioner: kubernetes.io/gce-pd
...@@ -53,7 +55,7 @@ parameters: ...@@ -53,7 +55,7 @@ parameters:
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/vsphere-volume provisioner: kubernetes.io/vsphere-volume
...@@ -67,7 +69,7 @@ parameters: ...@@ -67,7 +69,7 @@ parameters:
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: portworx-io-priority-high name: portworx-io-priority-high
provisioner: kubernetes.io/portworx-volume provisioner: kubernetes.io/portworx-volume
...@@ -91,7 +93,7 @@ For a complete example refer ([Portworx Volume docs](../../volumes/portworx/READ ...@@ -91,7 +93,7 @@ For a complete example refer ([Portworx Volume docs](../../volumes/portworx/READ
#### GLUSTERFS #### GLUSTERFS
```yaml ```yaml
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: slow name: slow
...@@ -141,7 +143,7 @@ When the persistent volumes are dynamically provisioned, the Gluster plugin auto ...@@ -141,7 +143,7 @@ When the persistent volumes are dynamically provisioned, the Gluster plugin auto
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: gold name: gold
provisioner: kubernetes.io/cinder provisioner: kubernetes.io/cinder
...@@ -156,7 +158,7 @@ parameters: ...@@ -156,7 +158,7 @@ parameters:
#### Ceph RBD #### Ceph RBD
```yaml ```yaml
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: fast name: fast
...@@ -184,7 +186,7 @@ parameters: ...@@ -184,7 +186,7 @@ parameters:
<!-- BEGIN MUNGE: EXAMPLE quobyte/quobyte-storage-class.yaml --> <!-- BEGIN MUNGE: EXAMPLE quobyte/quobyte-storage-class.yaml -->
```yaml ```yaml
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: slow name: slow
...@@ -270,7 +272,7 @@ $ kubectl create -f examples/persistent-volume-provisioning/quobyte/example-pod. ...@@ -270,7 +272,7 @@ $ kubectl create -f examples/persistent-volume-provisioning/quobyte/example-pod.
```yaml ```yaml
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/azure-disk provisioner: kubernetes.io/azure-disk
...@@ -286,18 +288,15 @@ parameters: ...@@ -286,18 +288,15 @@ parameters:
### User provisioning requests ### User provisioning requests
Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim`. Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim` using `spec.storageClassName` attribute.
The annotation `volume.beta.kubernetes.io/storage-class` is used to access this feature. It is required that this value matches the name of a `StorageClass` configured by the administrator. It is required that this value matches the name of a `StorageClass` configured by the administrator.
In the future, the storage class may remain in an annotation or become a field on the claim itself.
``` ```
{ {
"kind": "PersistentVolumeClaim", "kind": "PersistentVolumeClaim",
"apiVersion": "v1", "apiVersion": "v1",
"metadata": { "metadata": {
"name": "claim1", "name": "claim1"
"annotations": {
"volume.beta.kubernetes.io/storage-class": "slow"
} }
}, },
"spec": { "spec": {
...@@ -308,7 +307,8 @@ In the future, the storage class may remain in an annotation or become a field o ...@@ -308,7 +307,8 @@ In the future, the storage class may remain in an annotation or become a field o
"requests": { "requests": {
"storage": "3Gi" "storage": "3Gi"
} }
} },
"storageClassName": "slow"
} }
} }
``` ```
......
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/aws-ebs provisioner: kubernetes.io/aws-ebs
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
"kind": "PersistentVolumeClaim", "kind": "PersistentVolumeClaim",
"apiVersion": "v1", "apiVersion": "v1",
"metadata": { "metadata": {
"name": "claim1", "name": "claim1"
"annotations": {
"volume.beta.kubernetes.io/storage-class": "slow"
}
}, },
"spec": { "spec": {
"accessModes": [ "accessModes": [
...@@ -15,6 +12,7 @@ ...@@ -15,6 +12,7 @@
"requests": { "requests": {
"storage": "3Gi" "storage": "3Gi"
} }
} },
"storageClassName": "slow"
} }
} }
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: slow name: slow
provisioner: kubernetes.io/gce-pd provisioner: kubernetes.io/gce-pd
......
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: slow name: slow
......
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: slow name: slow
......
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:
name: slow name: slow
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment