From 02fbd8a0c60b3b052b189e4854fc06de69866378 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 7 Mar 2017 12:39:13 +0100 Subject: [PATCH] Update examples with storage.k8s.io/v1 --- .../persistent-volume-provisioning/README.md | 34 +++++++++---------- .../aws-ebs.yaml | 2 +- .../claim1.json | 8 ++--- .../gce-pd.yaml | 2 +- .../glusterfs-dp.yaml | 2 +- .../quobyte/quobyte-storage-class.yaml | 2 +- .../rbd/rbd-storage-class.yaml | 2 +- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/examples/persistent-volume-provisioning/README.md b/examples/persistent-volume-provisioning/README.md index d3ff1b664fa..912b6e003e4 100644 --- a/examples/persistent-volume-provisioning/README.md +++ b/examples/persistent-volume-provisioning/README.md @@ -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 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 ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/aws-ebs @@ -37,7 +39,7 @@ parameters: ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/gce-pd @@ -53,7 +55,7 @@ parameters: ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/vsphere-volume @@ -67,7 +69,7 @@ parameters: ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: portworx-io-priority-high provisioner: kubernetes.io/portworx-volume @@ -91,7 +93,7 @@ For a complete example refer ([Portworx Volume docs](../../volumes/portworx/READ #### GLUSTERFS ```yaml -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow @@ -141,7 +143,7 @@ When the persistent volumes are dynamically provisioned, the Gluster plugin auto ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: gold provisioner: kubernetes.io/cinder @@ -156,7 +158,7 @@ parameters: #### Ceph RBD ```yaml - apiVersion: storage.k8s.io/v1beta1 + apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: fast @@ -184,7 +186,7 @@ parameters: ```yaml -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow @@ -270,7 +272,7 @@ $ kubectl create -f examples/persistent-volume-provisioning/quobyte/example-pod. ```yaml kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/azure-disk @@ -286,18 +288,15 @@ parameters: ### User provisioning requests -Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim`. -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. -In the future, the storage class may remain in an annotation or become a field on the claim itself. +Users request dynamically provisioned storage by including a storage class in their `PersistentVolumeClaim` using `spec.storageClassName` attribute. +It is required that this value matches the name of a `StorageClass` configured by the administrator. ``` { "kind": "PersistentVolumeClaim", "apiVersion": "v1", "metadata": { - "name": "claim1", - "annotations": { - "volume.beta.kubernetes.io/storage-class": "slow" + "name": "claim1" } }, "spec": { @@ -308,7 +307,8 @@ In the future, the storage class may remain in an annotation or become a field o "requests": { "storage": "3Gi" } - } + }, + "storageClassName": "slow" } } ``` diff --git a/examples/persistent-volume-provisioning/aws-ebs.yaml b/examples/persistent-volume-provisioning/aws-ebs.yaml index f6d4ce90a6f..4fc5ba9242a 100644 --- a/examples/persistent-volume-provisioning/aws-ebs.yaml +++ b/examples/persistent-volume-provisioning/aws-ebs.yaml @@ -1,5 +1,5 @@ kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/aws-ebs diff --git a/examples/persistent-volume-provisioning/claim1.json b/examples/persistent-volume-provisioning/claim1.json index 6dc3a0d41b1..75c71a669c7 100644 --- a/examples/persistent-volume-provisioning/claim1.json +++ b/examples/persistent-volume-provisioning/claim1.json @@ -2,10 +2,7 @@ "kind": "PersistentVolumeClaim", "apiVersion": "v1", "metadata": { - "name": "claim1", - "annotations": { - "volume.beta.kubernetes.io/storage-class": "slow" - } + "name": "claim1" }, "spec": { "accessModes": [ @@ -15,6 +12,7 @@ "requests": { "storage": "3Gi" } - } + }, + "storageClassName": "slow" } } diff --git a/examples/persistent-volume-provisioning/gce-pd.yaml b/examples/persistent-volume-provisioning/gce-pd.yaml index 8aaa3225228..3d8e134bacf 100644 --- a/examples/persistent-volume-provisioning/gce-pd.yaml +++ b/examples/persistent-volume-provisioning/gce-pd.yaml @@ -1,5 +1,5 @@ kind: StorageClass -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/gce-pd diff --git a/examples/persistent-volume-provisioning/glusterfs-dp.yaml b/examples/persistent-volume-provisioning/glusterfs-dp.yaml index d14f034733c..ad2e76597c6 100644 --- a/examples/persistent-volume-provisioning/glusterfs-dp.yaml +++ b/examples/persistent-volume-provisioning/glusterfs-dp.yaml @@ -1,4 +1,4 @@ -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow diff --git a/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml b/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml index bf7be9bf27a..739b94fe916 100644 --- a/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml +++ b/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml @@ -1,4 +1,4 @@ -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow diff --git a/examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml b/examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml index 013fc292660..e2d7d67d98c 100644 --- a/examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml +++ b/examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml @@ -1,4 +1,4 @@ -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow