local-path-provisioner icon indicating copy to clipboard operation
local-path-provisioner copied to clipboard

Cannot attach ephemeral volume

Open krakazyabra opened this issue 4 years ago • 1 comments

Hello. Try to use local-path-provisioner in ephemeral colume. in my deployment I have

    - name: cache
      ephemeral:
        volumeClaimTemplate:
          spec:
            accessModes: [ "ReadWriteOnce" ]
            storageClassName: "local-path"
            resources:
              requests:
                storage: 3Gi

First replica shedulles on node, provisioner makes pv and pvc for it, pod mounts this pvc. everything is fine. But second and more replicas cannot start on other nodes. In pod describe I see:

Warning  FailedMount       0s (x10 over 2m1s)  kubelet, m8c1  (combined from similar events): Unable to attach or mount volumes: unmounted volumes=[cache], unattached volumes=[cache]: failed to get Plugin from volumeSpec for volume "cache" err=no volume plugin matched

In the same time provisioner reports, that it did its work

I1006 14:31:29.287057       1 controller.go:1202] provision "nextcloud/nextcloud-d4fc8575f-58kcg-cache" class "local-path": started
time="2021-10-06T14:31:29Z" level=debug msg="config doesn't contain node m8c1, use DEFAULT_PATH_FOR_NON_LISTED_NODES instead" 
time="2021-10-06T14:31:29Z" level=info msg="Creating volume pvc-c3d67218-1689-4f15-ad2a-581167928132 at m8c1:/data/local-path-provisioner/pvc-c3d67218-1689-4f15-ad2a-581167928132_nextcloud_nextcloud-d4fc8575f-58kcg-cache" 
time="2021-10-06T14:31:29Z" level=info msg="create the helper pod create-pvc-c3d67218-1689-4f15-ad2a-581167928132 into kube-system" 
I1006 14:31:29.318404       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"nextcloud", Name:"nextcloud-d4fc8575f-58kcg-cache", UID:"c3d67218-1689-4f15-ad2a-581167928132", APIVersion:"v1", ResourceVersion:"6887520742", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "nextcloud/nextcloud-d4fc8575f-58kcg-cache"

Also I see dir for this pv on node.

k8s ver: 1.22.2 kubelet ver: v1.19.6

But strange thing: if all replicas shedulle on same node, pvc attache to pods and pods are able to start.

krakazyabra avatar Oct 06 '21 14:10 krakazyabra