local-path-provisioner: Not working for subPath

Thanks for providing this provisioner. I am setting up MySQL HA using Kubernetes Stateful example.

I have tried this provisioner, but it is creating dynamic PV & mounting also but not in DEFAULT provided directory, but on this path /var/lib/kubelet/pods/82d24112-fc50-11e8-90e7-005056b146f6/volume-subpaths.

I found that it is happeing if I use subPath, otherwise it works well.

Any idea, how can I resolve this issue?

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 12
  • Comments: 16 (3 by maintainers)

Most upvoted comments

I came across the same issue:

  1. Create a single node Rancher cluster
  2. Install local-path-provisioner storage class
  3. Enable cluster level monitoring built into RKE, and enable persistent storage for Prometheus on the local-path storage class

I switched to https://github.com/openebs/dynamic-localpv-provisioner which supports subPath just fine.

I also just ran into this unwittingly in v0.0.22. If there is warning in the docs about subpath, I didn’t find it.

If this isn’t going to be fixed, how about using a webhook to reject subPath?

FYI, we’ve spend half a day to debug why our Prometheus is filling up the /var/lib/docker folder when provisioned by Rancher Monitoring V2.5, and found this issue and also https://github.com/rancher/rancher/issues/29149

# prometheus volume set by the operator:

     - mountPath: /prometheus                                                                                                                                                                                                              
       name: prometheus-rancher-monitoring-prometheus-db                                                                                                                                                                                   
       subPath: prometheus-db

An update of the Prometheus Operator should help in this case, the fix was validated on the linked ticket 23 days ago.