如何在GKE中创建具有读写多权限的动态持久卷声明?



目前GCEPersistentDisk不支持本地读写,有其他选项,如filestore创建NFS卷,但这里有两个问题:

  1. 需要创建最小1tb的大小

  2. 其次是手动创建pv和pvc

在GKE中动态分配索赔请求的最佳解决方案是什么?

如果您有动态配置的需求,您也可以尝试使用Gluster FS或Minio

下面是一个使用GlusterFS动态配置的好例子:https://docs.openshift.com/container-platform/3.9/install_config/storage_examples/gluster_dynamic_example.html

必须创建storagecclass

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: glusterfs
provisioner: kubernetes.io/glusterfs
parameters:
resturl: "http://10.42.0.0:8080" 
restauthenabled: "false"
并创建PVC使用特定的storagecclass
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gluster1
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 30Gi
storageClassName: glusterfs

还有你可以在1到63.9 TiB之间创建Filestore文件共享and动态配置: https://cloud.google.com/community/tutorials/gke-filestore-dynamic-provisioning

最新更新