--- api_metadata: apiVersion: "storage.k8s.io/v1" import: "k8s.io/api/storage/v1" kind: "StorageClass" content_type: "api_reference" description: "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned." title: "StorageClass" weight: 6 auto_generated: true --- `apiVersion: storage.k8s.io/v1` `import "k8s.io/api/storage/v1"` ## StorageClass {#StorageClass} StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.
- **apiVersion**: storage.k8s.io/v1 - **kind**: StorageClass - **metadata** (}}">ObjectMeta) Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **provisioner** (string), required Provisioner indicates the type of the provisioner. - **allowVolumeExpansion** (boolean) AllowVolumeExpansion shows whether the storage class allow volume expand - **allowedTopologies** ([]TopologySelectorTerm) *Atomic: will be replaced during a merge* Restrict the node topologies where volumes can be dynamically provisioned. Each volume plugin defines its own supported topology specifications. An empty TopologySelectorTerm list means there is no topology restriction. This field is only honored by servers that enable the VolumeScheduling feature. *A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.* - **allowedTopologies.matchLabelExpressions** ([]TopologySelectorLabelRequirement) A list of topology selector requirements by labels. *A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.* - **allowedTopologies.matchLabelExpressions.key** (string), required The label key that the selector applies to. - **allowedTopologies.matchLabelExpressions.values** ([]string), required An array of string values. One value must match the label to be selected. Each entry in Values is ORed. - **mountOptions** ([]string) Dynamically provisioned PersistentVolumes of this storage class are created with these mountOptions, e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid. - **parameters** (map[string]string) Parameters holds the parameters for the provisioner that should create volumes of this storage class. - **reclaimPolicy** (string) Dynamically provisioned PersistentVolumes of this storage class are created with this reclaimPolicy. Defaults to Delete. - **volumeBindingMode** (string) VolumeBindingMode indicates how PersistentVolumeClaims should be provisioned and bound. When unset, VolumeBindingImmediate is used. This field is only honored by servers that enable the VolumeScheduling feature. ## StorageClassList {#StorageClassList} StorageClassList is a collection of storage classes.
- **apiVersion**: storage.k8s.io/v1 - **kind**: StorageClassList - **metadata** (}}">ListMeta) Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **items** ([]}}">StorageClass), required Items is the list of StorageClasses ## Operations {#Operations}
### `get` read the specified StorageClass #### HTTP Request GET /apis/storage.k8s.io/v1/storageclasses/{name} #### Parameters - **name** (*in path*): string, required name of the StorageClass - **pretty** (*in query*): string }}">pretty #### Response 200 (}}">StorageClass): OK 401: Unauthorized ### `list` list or watch objects of kind StorageClass #### HTTP Request GET /apis/storage.k8s.io/v1/storageclasses #### Parameters - **allowWatchBookmarks** (*in query*): boolean }}">allowWatchBookmarks - **continue** (*in query*): string }}">continue - **fieldSelector** (*in query*): string }}">fieldSelector - **labelSelector** (*in query*): string }}">labelSelector - **limit** (*in query*): integer }}">limit - **pretty** (*in query*): string }}">pretty - **resourceVersion** (*in query*): string }}">resourceVersion - **resourceVersionMatch** (*in query*): string }}">resourceVersionMatch - **timeoutSeconds** (*in query*): integer }}">timeoutSeconds - **watch** (*in query*): boolean }}">watch #### Response 200 (}}">StorageClassList): OK 401: Unauthorized ### `create` create a StorageClass #### HTTP Request POST /apis/storage.k8s.io/v1/storageclasses #### Parameters - **body**: }}">StorageClass, required - **dryRun** (*in query*): string }}">dryRun - **fieldManager** (*in query*): string }}">fieldManager - **fieldValidation** (*in query*): string }}">fieldValidation - **pretty** (*in query*): string }}">pretty #### Response 200 (}}">StorageClass): OK 201 (}}">StorageClass): Created 202 (}}">StorageClass): Accepted 401: Unauthorized ### `update` replace the specified StorageClass #### HTTP Request PUT /apis/storage.k8s.io/v1/storageclasses/{name} #### Parameters - **name** (*in path*): string, required name of the StorageClass - **body**: }}">StorageClass, required - **dryRun** (*in query*): string }}">dryRun - **fieldManager** (*in query*): string }}">fieldManager - **fieldValidation** (*in query*): string }}">fieldValidation - **pretty** (*in query*): string }}">pretty #### Response 200 (}}">StorageClass): OK 201 (}}">StorageClass): Created 401: Unauthorized ### `patch` partially update the specified StorageClass #### HTTP Request PATCH /apis/storage.k8s.io/v1/storageclasses/{name} #### Parameters - **name** (*in path*): string, required name of the StorageClass - **body**: }}">Patch, required - **dryRun** (*in query*): string }}">dryRun - **fieldManager** (*in query*): string }}">fieldManager - **fieldValidation** (*in query*): string }}">fieldValidation - **force** (*in query*): boolean }}">force - **pretty** (*in query*): string }}">pretty #### Response 200 (}}">StorageClass): OK 201 (}}">StorageClass): Created 401: Unauthorized ### `delete` delete a StorageClass #### HTTP Request DELETE /apis/storage.k8s.io/v1/storageclasses/{name} #### Parameters - **name** (*in path*): string, required name of the StorageClass - **body**: }}">DeleteOptions - **dryRun** (*in query*): string }}">dryRun - **gracePeriodSeconds** (*in query*): integer }}">gracePeriodSeconds - **pretty** (*in query*): string }}">pretty - **propagationPolicy** (*in query*): string }}">propagationPolicy #### Response 200 (}}">StorageClass): OK 202 (}}">StorageClass): Accepted 401: Unauthorized ### `deletecollection` delete collection of StorageClass #### HTTP Request DELETE /apis/storage.k8s.io/v1/storageclasses #### Parameters - **body**: }}">DeleteOptions - **continue** (*in query*): string }}">continue - **dryRun** (*in query*): string }}">dryRun - **fieldSelector** (*in query*): string }}">fieldSelector - **gracePeriodSeconds** (*in query*): integer }}">gracePeriodSeconds - **labelSelector** (*in query*): string }}">labelSelector - **limit** (*in query*): integer }}">limit - **pretty** (*in query*): string }}">pretty - **propagationPolicy** (*in query*): string }}">propagationPolicy - **resourceVersion** (*in query*): string }}">resourceVersion - **resourceVersionMatch** (*in query*): string }}">resourceVersionMatch - **timeoutSeconds** (*in query*): integer }}">timeoutSeconds #### Response 200 (}}">Status): OK 401: Unauthorized