local-path-provisioner
local-path-provisioner copied to clipboard
Unmounted storage protection
Hi the created volumes are having type: DirectoryOrCreate property.
But it might be unsafe in case if data storage is unmounted for some reason, because application can be started with the empty directory created in different place.
I'm sure that using type: Directory will solve this problem
https://github.com/rancher/local-path-provisioner/blob/b44b2c3b5d18772aa306d3fb1210b202c353ef09/provisioner.go#L205
Sorry @kvaps I need to revert this change for now. Somehow it doesn't work with my RKE cluster. I always get the error when trying to start the pod:
MountVolume.SetUp failed for volume "pvc-xxxx" : hostPath type check failed: /opt/local-path-provisioner/pvc-xxxxx is not a directory
But is it directory? :)
Yes it is…
Weird, what kubelet version do you have?
I am using Rancher Kubernetes Engine (RKE), which is a containerized kubelet.
@yasker I'm out of context, but most likely if you're using RKE, you will need to specify somewhere in your cluster.yml something along the lines of
kubelet:
extra_binds:
- /opt/local-path-provisioner
refer to the RKE docs to get everything right.
Okay I prepared a new PR https://github.com/rancher/local-path-provisioner/pull/224