StorageClass [storage.k8s.io/v1]

Description
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.
Type
object
Required
provisioner

Specification

PropertyTypeDescription
allowVolumeExpansionboolean

allowVolumeExpansion shows whether the storage class allow volume expand.

allowedTopologiesarray

allowedTopologies 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.

apiVersionstring

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

kindstring

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadataObjectMeta

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

mountOptionsarray

mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.

parametersobject

parameters holds the parameters for the provisioner that should create volumes of this storage class.

provisionerstring

provisioner indicates the type of the provisioner.

reclaimPolicystring

reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. Defaults to Delete.

Possible enum values:

  • "Delete" means the volume will be deleted from Kubernetes on release from its claim. The volume plugin must support Deletion.
  • "Recycle" means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. The volume plugin must support Recycling.
  • "Retain" means the volume will be left in its current phase (Released) for manual reclamation by the administrator. The default policy is Retain.
volumeBindingModestring

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.

Possible enum values:

  • "Immediate" indicates that PersistentVolumeClaims should be immediately provisioned and bound. This is the default mode.
  • "WaitForFirstConsumer" indicates that PersistentVolumeClaims should not be provisioned and bound until the first Pod is created that references the PeristentVolumeClaim. The volume provisioning and binding will occur during Pod scheduing.

.allowedTopologies

Description
allowedTopologies 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.
Type
array

.allowedTopologies[]

Description
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.
Type
object
PropertyTypeDescription
matchLabelExpressionsarray

A list of topology selector requirements by labels.

.allowedTopologies[].matchLabelExpressions

Description
A list of topology selector requirements by labels.
Type
array

.allowedTopologies[].matchLabelExpressions[]

Description
A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.
Type
object
Required
keyvalues
PropertyTypeDescription
keystring

The label key that the selector applies to.

valuesarray

An array of string values. One value must match the label to be selected. Each entry in Values is ORed.

.allowedTopologies[].matchLabelExpressions[].values

Description
An array of string values. One value must match the label to be selected. Each entry in Values is ORed.
Type
array

.allowedTopologies[].matchLabelExpressions[].values[]

Type
string

.mountOptions

Description
mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. e.g. ["ro", "soft"]. Not validated - mount of the PVs will simply fail if one is invalid.
Type
array

.mountOptions[]

Type
string

.parameters

Description
parameters holds the parameters for the provisioner that should create volumes of this storage class.
Type
object

API Endpoints

The following API endpoints are available:

  • /kubernetes/{cluster}/apis/storage.k8s.io/v1/storageclasses
    • DELETE: delete collection of StorageClass
    • GET: list objects of kind StorageClass
    • POST: create a new StorageClass
  • /kubernetes/{cluster}/apis/storage.k8s.io/v1/storageclasses/{name}
    • DELETE: delete the specified StorageClass
    • GET: read the specified StorageClass
    • PATCH: partially update the specified StorageClass
    • PUT: replace the specified StorageClass

/kubernetes/{cluster}/apis/storage.k8s.io/v1/storageclasses

HTTP method
DELETE
Description
delete collection of StorageClass
HTTP responses
HTTP codeResponse body
200 - OKStatus schema
401 - UnauthorizedEmpty
HTTP method
GET
Description
list objects of kind StorageClass
HTTP responses
HTTP codeResponse body
200 - OKStorageClassList schema
401 - UnauthorizedEmpty
HTTP method
POST
Description
create a new StorageClass
Query parameters
ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
Body parameters
ParameterTypeDescription
bodyStorageClass schemaapplication/json formatted
HTTP responses
HTTP codeResponse body
200 - OKStorageClass schema
201 - CreatedStorageClass schema
202 - AcceptedStorageClass schema
401 - UnauthorizedEmpty

/kubernetes/{cluster}/apis/storage.k8s.io/v1/storageclasses/{name}

HTTP method
DELETE
Description
delete the specified StorageClass
Query parameters
ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
HTTP responses
HTTP codeResponse body
200 - OKStatus schema
202 - AcceptedStatus schema
401 - UnauthorizedEmpty
HTTP method
GET
Description
read the specified StorageClass
HTTP responses
HTTP codeResponse body
200 - OKStorageClass schema
401 - UnauthorizedEmpty
HTTP method
PATCH
Description
partially update the specified StorageClass
Query parameters
ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
HTTP responses
HTTP codeResponse body
200 - OKStorageClass schema
401 - UnauthorizedEmpty
HTTP method
PUT
Description
replace the specified StorageClass
Query parameters
ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
Body parameters
ParameterTypeDescription
bodyStorageClass schemaapplication/json formatted
HTTP responses
HTTP codeResponse body
200 - OKStorageClass schema
201 - CreatedStorageClass schema
401 - UnauthorizedEmpty