|
| 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 | +Volume Attributes Classes in {product-title} is available only with AWS Elastic Block Storage (EBS) and Google Cloud Platform (GCP) persistent disk (PD) 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 needed. |
| 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 | +== Limitations |
| 22 | +Volume Attributes Classes has the following limitations: |
| 23 | + |
| 24 | +* When using with GCP, `diskType` must be set to `hyperdisk-balanced`. |
| 25 | + |
| 26 | +* No more than 512 parameters can be defined for a `VolumeAttributesClass`. |
| 27 | + |
| 28 | +* The total length of the parameter's object, including its keys and values, cannot exceed 256 KiB. |
| 29 | + |
| 30 | +== Enabling Volume Attributes Classes |
| 31 | +Volume Attributes Classes are not enabled by default. |
| 32 | + |
| 33 | +To enable Volume Attributes Classes, follow the procedure in section _Enabling {product-title} features using FeatureGates_. |
| 34 | + |
| 35 | +== Defining Volume Attributes Classes |
| 36 | + |
| 37 | +The following is an example Volume Attributes Class YAML file. |
| 38 | + |
| 39 | +.`VolumeAttributesClass` definition example |
| 40 | +[source,yaml] |
| 41 | +---- |
| 42 | +apiVersion: storage.k8s.io/v1beta1 |
| 43 | +kind: VolumeAttributesClass <1> |
| 44 | +metadata: |
| 45 | + name: silver <2> |
| 46 | +driverName: ebs.csi.aws.com <3> |
| 47 | +parameters: |
| 48 | + iops: "300" |
| 49 | + throughput: "125" |
| 50 | + type: io2 <4> |
| 51 | + ... |
| 52 | +---- |
| 53 | +<1> Defines object as Volumes Attributes Classes |
| 54 | +<2> Name of the `VolumeAttributesClass`. In this example, it is "silver". |
| 55 | +<3> The provisioner that determines what volume plugin is used for provisioning persistent volumes (PVs). In this example, it is "ebs.csi.aws.com" for AWS EBS. |
| 56 | +<4> Disk type. |
| 57 | + |
| 58 | +== Applying a Volume Attribute Class to a PVC |
| 59 | +In addition to newly created PVCs, you can also update existing bound PVCs with a Volume Attribute Class. |
| 60 | + |
| 61 | +To apply a Volume Attribute Class to a PVC: |
| 62 | + |
| 63 | +* Set the PVC's `volumeAttributesClassName` parameter to the Volume Attribute Class's name: |
| 64 | ++ |
| 65 | +.PVC definition example specifying a Volume Attribute Class |
| 66 | ++ |
| 67 | +[source,yaml] |
| 68 | +---- |
| 69 | +apiVersion: v1 |
| 70 | +kind: PersistentVolumeClaim |
| 71 | +metadata: |
| 72 | + name: test-pv-claim |
| 73 | +spec: |
| 74 | + … |
| 75 | + volumeAttributesClassName: silver <1> |
| 76 | +---- |
| 77 | +<1> Specifies using the Volume Attribute Class "silver" for this PVC. |
0 commit comments