执行如下命令,配置名为“pvc-obs-auto-example.yaml”的创建PVC的yaml文件。
touch pvc-obs-auto-example.yaml
vi pvc-obs-auto-example.yaml
1.15及以上版本的集群,yaml配置示例如下:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
everest.io/obs-volume-type: STANDARD
csi.storage.k8s.io/fstype: s3fs
name: obs-warm-provision-pvc
namespace: default
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: csi-obs
其中:
everest.io/obs-volume-type:桶类型,当前支持标准(STANDARD)和低频(WARM)两种桶。
name:创建的PVC名称。
accessModes:只支持ReadWriteMany,不支持ReadWriteOnly。
storage:存储容量,单位为Gi,对OBS桶来说,此处仅为校验需要(不能为空和0),设置的大小不起作用,此处设定为固定值1Gi。
csi.storage.k8s.io/fstype: