Mailu / helm-charts

Development repo for helm charts
127 stars 131 forks source link

[BUG] persistence.hostPath with a default storageClass not working. #256

Open Florian7843 opened 1 year ago

Florian7843 commented 1 year ago

Describe the bug When using the persistence.hostPath value and having a default storageClass defined in the Kubernetes cluster. The final PVC will still have the storageClassName with the value of the default storageClass attached. This results in the following error/warning event: Cannot bind to requested volume "mailu-storage": storageClassName does not match

Environment K3s Kubernetes cluster with Longhorn set as default storage class.

Additional context Problem can be avoided by removing the default attribute from the storageClass with the following command: kubectl patch storageclasses.storage.k8s.io <YOUR_CURRENT_DEFAULT_STORAGECLASS> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'

cloud27 commented 1 year ago

Hello, I have the same problem with the persistence.hostPath with K3s. For information set persistence.storageClass to - doesn't resolve the issue.

Anyone find a solution ?

Thanks

kooskaspers commented 1 year ago

This is my solution:

Edit the yaml of the persistent volume (pv) and add below the 'spec' section: storageClassname: local-path

Reapply the configuration and the pvc should bind with the pv again.

gnuion commented 7 months ago

storageClassname: local-path

spec: storageClassName: local-path

Capital N