gluster / gluster-kubernetes

GlusterFS Native Storage Service for Kubernetes
Apache License 2.0
875 stars 390 forks source link

storageClassName support in PVC #520

Open sekrett opened 6 years ago

sekrett commented 6 years ago

Documentation says I should create a PVC this way:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
 name: my-pvc
 annotations:
   volume.beta.kubernetes.io/storage-class: gluster-heketi
spec:
 accessModes:
  - ReadWriteMany
 resources:
   requests:
     storage: 10Gi

It works but there are many helm chart which generate a PVC in a different way:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: gluster-heketi

And this PVC will fail to create. Maybe specifying annotations is an old way and storageClassName support should be added now for convenience?

sekrett commented 6 years ago

According to Kubernetes PVC documentation:

In the past, the annotation volume.beta.kubernetes.io/storage-class was used instead of the storageClassName attribute. This annotation is still working, however it will become fully deprecated in a future Kubernetes release.

Please add support for new syntax.