Comment 2 for bug 1996809

Revision history for this message
George Kraft (cynerva) wrote :

From https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/

> Please note that at most one StorageClass can be marked as default. If two or more of them are marked as default, a PersistentVolumeClaim without storageClassName explicitly specified cannot be created.

Given this behavior, I think that perhaps there could be a config option on charms that provide storage, something like "storage-class-default" that defaults to True.

Then in the case where you have just the one charm providing storage: there is only one default storage class, and everything "just works".

And in the case where you have more than one charm providing storage: there are multiple default storage classes, so Kubernetes treats it as if there is no default. The user is forced to specify storageClassName explicitly in their PVCs, OR update charm configuration to remove the conflicting defaults. It forces the user to make an explicit choice one way or another, which seems like a good thing to have them do.