local-path-provisioner
local-path-provisioner copied to clipboard
Storage class configured for shared volumes does not syncronize between nodes
I've deployed rancher local path provisioner v0.0.28 on a k8s cluster via helm and configured with the configMap options:
kind: ConfigMap
apiVersion: v1
metadata:
name: local-path-config
namespace: "{{ .Release.Namespace }}"
data:
config.json: |-
{
"storageClassConfigs":{
"local-path": {
"nodePathMap": [
{
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths":["/opt/local-path-provisioner"]
}
]
},
"local-path-shared": {
"sharedFilesystemPath": "/opt/local-path-provisioner-shared"
}
}
}
setup: |-
#!/bin/sh
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
set -eu
rm -rf "$VOL_DIR"
helperPod.yaml: |-
apiVersion: v1
kind: Pod
metadata:
name: helper-pod
spec:
priorityClassName: system-node-critical
tolerations:
- key: node.kubernetes.io/disk-pressure
operator: Exists
effect: NoSchedule
containers:
- name: helper-pod
image: busybox
imagePullPolicy: IfNotPresent
I've also create the storage class:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-path-shared
provisioner: rancher.io/local-path
volumeBindingMode: Immediate
reclaimPolicy: Delete
And finally used on a pvc:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-vol
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: "local-path-shared"
The main problem is that when I create a pvc the pvc directory is correctly created on all nodes, but the content isn't syncronized. i.e A pod on node-1 touch a file named test.txt, but on node-1+X the test.txt files isn't created.
Did I missed something or this is the expected behavior ?