导入存储
功能介绍
导入已有存储到指定的命名空间。
当前支持导入EVS(云硬盘卷,块存储)、SFS(文件存储卷)、SFS Turbo(极速文件存储卷)、OBS(对象存储卷),使用时 spec.storageClassName 参数的取值如下:
- sata:普通I/O云硬盘卷
- sas:高I/O云硬盘卷
- ssd:超高I/O云硬盘卷
- nfs-rw:标准文件协议类型文件存储卷
- efs-performance:性能型极速文件存储卷
- efs-standard:标准型极速文件存储卷
- obs:对象存储卷
- 回收策略采用 DELETE,即PVC被删除后,立即删除存储。如果需要保留存储,可使用解绑存储接口。
- OBS对象存储包含“对象桶”和“并行文件系统”两种类型。并行文件系统是OBS提供的一种经过优化的高性能文件系统,提供毫秒级别访问时延,以及TB/s级别带宽和百万级别的IOPS,相较于OBS对象存储在稳定性、性能上更具优势。因此如需通过挂载方式,生产环境中推荐您使用OBS并行文件系统,而不推荐OBS对象存储。
URI
POST /api/v1/namespaces/{namespace}/extended-persistentvolumeclaims
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
namespace |
String |
命名空间。 |
请求消息
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
apiVersion |
Yes |
String |
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. |
|
kind |
Yes |
String |
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. |
|
metadata |
Yes |
Object |
Standard object's metadata. 详情请参见表10。 其中annotations字段请参见表3。 |
|
spec |
Yes |
Object |
Spec defines the desired characteristics of a volume requested by a pod author. 详情请参见表177。 |
|
status |
No |
Object |
Status represents the current information/status of a persistent volume claim. Read-only. 详情请参见表178。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
fsType |
Yes |
String |
文件系统名称。可设置为:
|
|
volumeID |
Yes |
String |
卷id。 |
|
deviceMountPath |
No |
String |
共享路径。
说明:
只有文件存储卷和极速文件存储卷需要设置该值。 |
请求示例
{
"apiVersion": "v1",
"kind": "PersistentVolumeClaim",
"metadata": {
"annotations": {
"fsType": "nfs",
"volumeID": "378dfa73-3ae4-4179-81c0-67699976b505",
"deviceMountPath": "sfs-nas01.cn-north-4b.myhuaweicloud.com:/share-84b38e4d"
},
"name": "cci-sfs-jxre8q80-ylpd",
"namespace": "test-namespace"
},
"spec": {
"resources": {
"requests": {
"storage": "10Gi"
}
},
"storageClassName": "nfs-rw"
}
}
响应消息
响应参数
|
参数 |
类型 |
描述 |
|---|---|---|
|
PersistentVolumeClaim |
Object |
详情请参见表175。 |
响应示例
{
"metadata": {
"name": "pvc-import-evs",
"namespace": "test-namespace",
"selfLink": "/api/v1/namespaces/test-namespace/persistentvolumeclaims/pvc-import-evs",
"uid": "17646a17-a471-11e9-be8a-b44326d0c915",
"resourceVersion": "65016560",
"creationTimestamp": "2019-07-12T06:48:44Z",
"annotations": {
"kubernetes.io/volumeId": "378dfa73-3ae4-4179-81c0-67699976b505"
}
},
"spec": {
"accessModes": [
"ReadWriteMany"
],
"resources": {
"requests": {
"storage": "10"
}
},
"storageClassName": "sata"
},
"status": {
"phase": "Pending"
}
}