kubernetes-csi/csi-driver-host-path

MountVolume.SetUp failed for volume "my-csi-volume" : rpc error: code = Unknown

ole1986 opened this issue · 1 comments

I am trying to get the CSI driver running, but receive the following error while running the pod csi-app-inline.yaml from the example

MountVolume.SetUp failed for volume "my-csi-volume" : rpc error: code = Unknown desc = create target path: 
mkdir /var/snap/microk8s/common/var/lib/kubelet/pods/xxx/volumes/kubernetes.io~csi/xxx/mount: no such file or directory

Its a single host I am running
Any advice on how to fix this?

Below some details about the kubernetes I am running

MicroK8s v1.28.9 revision 6750

microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    dns                  # (core) CoreDNS
    ha-cluster           # (core) Configure high availability on the current node
    hostpath-storage     # (core) Storage class; allocates storage from host directory
    ingress              # (core) Ingress controller for external access
    rbac                 # (core) Role-Based Access Control for authorisation
    registry             # (core) Private image registry exposed on localhost:32000
    storage              # (core) Alias to hostpath-storage add-on, deprecated

For microk8s it is required to pass the ENV KUBELET_DATA_DIR accordingly.
Example

KUBELET_DATA_DIR=/var/snap/microk8s/common/var/lib/kubelet deploy/kubernetes-latest/deploy.sh