linode / linode-blockstorage-csi-driver

Container Storage Interface (CSI) Driver for Linode Block Storage
Apache License 2.0
66 stars 55 forks source link

Need to have ability to pass different hostPath for pods-mount-dir #135

Closed prgavali closed 10 months ago

prgavali commented 11 months ago

Need to have ability to pass different hostPath for pods-mount-dir


Feature Requests:


Bug Reporting

We tried to install the linode-blockstorage-csi-driver on IBM Cloud satellite. The installation worked fine with NodeService and ControllerService up and running without any error in the log. The PVC creation also worked fine . However, when we attach the volume to POD and write some data to it , it is getting erased when POD is restarted . The volume mount was not happening on the correct path . After some debug , we found that the pods-mount-dir should /var/data/kubelet instead of default /var/lib/kubelet We changed below lines and redeployed the driver and it started using correct path for volume mount . Thus, data got persisted over the POD restarts .


        volumeMounts:
         .
         .
         .

        - mountPath: /var/lib/kubelet  ---> /var/data/kubelet 
          mountPropagation: Bidirectional
          name: pods-mount-dir
          .
          .
          .     
volumes:
       .
       .
       .
      - hostPath:
          path: /var/lib/kubelet ---> /var/data/kubelet 
          type: Directory
        name: pods-mount-dir
       .
       .
       .

Expected Behavior

The consumer of this driver should be able to pass/configure different hostPath for pods-mount-dir based on the environment. The helm char value might be one option

Actual Behavior

There is not way to pass/configure different hostPath for pods-mount-dir based on the environment.

Steps to Reproduce the Problem

  1. Create the cluster on IBM cloud satellite
  2. Install linode-blockstorage-csi-driver using helm chart
  3. Create PVC with linode-block-storage storageclass
  4. Attache the PVC to POD
  5. Write some data to the mounted volume
  6. Restart the POD.
  7. The old data from the mounted volume will be erases

Environment Specifications

IBM Cloud Satellite with Linode host and block storage

Screenshots, Code Blocks, and Logs

image

Ref:https://github.com/linode/linode-blockstorage-csi-driver/pull/120#issuecomment-1775273834

Additional Notes


For general help or discussion, join the Kubernetes Slack team channel #linode. To sign up, use the Kubernetes Slack inviter.

The Linode Community is a great place to get additional support.

srust commented 11 months ago

The ask here (and fix) is to add the kubelet directory configurable in the helm chart values.

srust commented 10 months ago

This is closed by #148