ods-core icon indicating copy to clipboard operation
ods-core copied to clipboard

why we need define storage-provisioner on persistentVolumeClaim

Open stefanlack opened this issue 6 years ago • 1 comments

Describe the Question

I want to discuss why the storage-provisioner has to be configurable, as defined in pvc.yml:

- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      volume.beta.kubernetes.io/storage-class: ${STORAGE_CLASS_DATA}
      volume.beta.kubernetes.io/storage-provisioner: ${STORAGE_PROVISIONER}

The provisioner can be defined in the storage-class, that is referenced by the annotation volume.beta.kubernetes.io/storage-class

For example, a storage-class for local-storage can be defined:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: local-storage
  annotations:
    storageclass.kubernetes.io/is-default-class: 'true'
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Delete

stefanlack avatar Oct 16 '19 15:10 stefanlack

For some background on this, see #22.

However, I did not know about StorageClass, so maybe this is a better solution to the problem. I am definitely open for a change.

Could you explain a little what issues you have with the current approach or which downsides you see with it?

michaelsauter avatar Oct 16 '19 15:10 michaelsauter