StorageClass [storage.k8s.io/v1]

描述
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.
类型
object
必填
provisioner

规格

属性类型描述
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

描述
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.
类型
array

.allowedTopologies[]

描述
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.
类型
object
属性类型描述
matchLabelExpressionsarray

A list of topology selector requirements by labels.

.allowedTopologies[].matchLabelExpressions

描述
A list of topology selector requirements by labels.
类型
array

.allowedTopologies[].matchLabelExpressions[]

描述
A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.
类型
object
必填
keyvalues
属性类型描述
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

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

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

类型
string

.mountOptions

描述
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.
类型
array

.mountOptions[]

类型
string

.parameters

描述
parameters holds the parameters for the provisioner that should create volumes of this storage class.
类型
object

API 端点

可用的 API 端点如下:

  • /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 方法
DELETE
描述
delete collection of StorageClass
HTTP 响应
HTTP 状态码响应体
200 - OKStatus schema
401 - UnauthorizedEmpty
HTTP 方法
GET
描述
list objects of kind StorageClass
HTTP 响应
HTTP 状态码响应体
200 - OKStorageClassList schema
401 - UnauthorizedEmpty
HTTP 方法
POST
描述
create a new StorageClass
查询参数
参数类型描述
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.
请求体参数
参数类型描述
bodyStorageClass schemaapplication/json formatted
HTTP 响应
HTTP 状态码响应体
200 - OKStorageClass schema
201 - CreatedStorageClass schema
202 - AcceptedStorageClass schema
401 - UnauthorizedEmpty

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

HTTP 方法
DELETE
描述
delete the specified StorageClass
查询参数
参数类型描述
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 响应
HTTP 状态码响应体
200 - OKStatus schema
202 - AcceptedStatus schema
401 - UnauthorizedEmpty
HTTP 方法
GET
描述
read the specified StorageClass
HTTP 响应
HTTP 状态码响应体
200 - OKStorageClass schema
401 - UnauthorizedEmpty
HTTP 方法
PATCH
描述
partially update the specified StorageClass
查询参数
参数类型描述
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 响应
HTTP 状态码响应体
200 - OKStorageClass schema
401 - UnauthorizedEmpty
HTTP 方法
PUT
描述
replace the specified StorageClass
查询参数
参数类型描述
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.
请求体参数
参数类型描述
bodyStorageClass schemaapplication/json formatted
HTTP 响应
HTTP 状态码响应体
200 - OKStorageClass schema
201 - CreatedStorageClass schema
401 - UnauthorizedEmpty