|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * storage/understanding-persistent-storage.adoc |
| 4 | +// |
| 5 | + |
| 6 | +:_mod-docs-content-type: CONCEPT |
| 7 | +[id="storage-persistent-storage-pvc-volumeattributesclass_{context}"] |
| 8 | += Volume Attributes Classes |
| 9 | + |
| 10 | +Volume Attributes Classes provide a way for administrators to describe "classes" of storage they offer. Different classes might correspond to different quality-of-service levels. |
| 11 | + |
| 12 | +:FeatureName: Volume Attributes Classes |
| 13 | +include::snippets/technology-preview.adoc[leveloffset=+1] |
| 14 | + |
| 15 | +You can only use Volume Attributes Classes in {product-title} with AWS Elastic Block Storage (EBS) Container Storage Interface (CSI). |
| 16 | + |
| 17 | +You can apply a Volume Attributes Class to a persistent volume claim (PVC). If a new Volume Attributes Class becomes available in the cluster, a user can update the PVC with the new Volume Attributes Class if desired. |
| 18 | + |
| 19 | +Volume Attribute Classes have parameters that describe volumes belonging to them. Different parameters can be accepted depending on the provisioner or the resizer. If a parameter is omitted, the default is used at volume provisioning. If a user applies the PVC with a different Volume Attributes Class with omitted parameters, the default value of the parameters might be used depending on the CSI driver implementation. For more information, see the related CSI driver documentation . |
| 20 | + |
| 21 | +There can be at most 512 parameters defined for a `VolumeAttributesClass`. The total length of the parameters object including its keys and values cannot exceed 256 KiB. |
| 22 | + |
| 23 | +== Enabling Volume Attributes Classes |
| 24 | +Volume Attributes Classes are not enabled by default. |
| 25 | + |
| 26 | +To enable Volume Attributes Classes, follow the procedure in xref:../nodes/clusters/nodes-cluster-enabling-features.adoc#nodes-cluster-enabling-features[Enabling {product-title} features using FeatureGates]. |
| 27 | + |
| 28 | +== Defining Volume Attributes Classes |
| 29 | + |
| 30 | +The following is an example Volume Attributes Class YAML file. |
| 31 | + |
| 32 | +.`VolumeAttributesClass` definition example |
| 33 | +[source,yaml] |
| 34 | +---- |
| 35 | +apiVersion: storage.k8s.io/v1beta1 |
| 36 | +kind: VolumeAttributesClass <1> |
| 37 | +metadata: |
| 38 | + name: silver <2> |
| 39 | +driverName: pd.csi.storage.gke.io <3> |
| 40 | +parameters: |
| 41 | + provisioned-iops: "3000" |
| 42 | + provisioned-throughput: "50" |
| 43 | + ... |
| 44 | +---- |
| 45 | +<1> Defines object as Volumes Attributes Classes |
| 46 | +<2> Name of the `VolumeAttributesClass`. In this example, it is "silver". |
| 47 | +<3> The provisioner that determines what volume plugin is used for provisioning persistent volumes (PVs). In this example, it is "pd.csi.storage.gke.io" for GCE Persistent Disk (gcePD). |
| 48 | + |
| 49 | +== Applying a Volume Attribute Class to a PVC |
| 50 | + |
| 51 | +To apply a Volume Attribute Class to a PVC: |
| 52 | + |
| 53 | +* Set the PVC's `volumeAttributesClassName` parameter to the Volume Attribute Class's name: |
| 54 | ++ |
| 55 | +.PVC definition example specifying a Volume Attribute Class |
| 56 | ++ |
| 57 | +[source,yaml] |
| 58 | +---- |
| 59 | +apiVersion: v1 |
| 60 | +kind: PersistentVolumeClaim |
| 61 | +metadata: |
| 62 | + name: test-pv-claim |
| 63 | +spec: |
| 64 | + … |
| 65 | + volumeAttributesClassName: silver <1> |
| 66 | +---- |
| 67 | +<1> Specifies using the Volume Attribute Class "silver" for this PVC. |
0 commit comments