# Adding custom driver to Flex Volume

**URL:** <https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578>\
**Category:** SUSE Rancher Prime\
**Created:** [May 26, 2018, 6:32pm UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578 "2018-05-26T18:32:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkmuk](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jkmuk](https://forums.suse.com/u/jkmuk)\
**Post date:** [May 26, 2018, 6:32pm UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/1 "2018-05-26T18:32:39Z")

</div>

How does one add a custom driver to Flex Volume storage plugin in Rancher 2.0 ? I am trying to add a CIFS driver using project “juliohm/kubernetes-cifs-volumedriver” . Any help to get this done will be very helpful. Thanks.

---

<div class="post-metadata">

**Author:** ![Coopyrightdmin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/coopyrightdmin/32/2908_2.png) [@Coopyrightdmin](https://forums.suse.com/u/Coopyrightdmin)\
**Post date:** [July 3, 2018, 2:04pm UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/2 "2018-07-03T14:04:56Z")

</div>

I am facing exactly the same issue.  
Did you managed to solve it?

---

<div class="post-metadata">

**Author:** ![etlweather](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/etlweather/32/419_2.png) [@etlweather](https://forums.suse.com/u/etlweather)\
**Post date:** [July 31, 2018, 1:21am UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/3 "2018-07-31T01:21:50Z")

</div>

Per this [GitHub issue](https://github.com/rancher/rke/issues/502) and per my inspection, the `/var/lib/kubelet` directory is already mounted on the host so the location of the volume plugins is be `/var/lib/kubelet/volumeplugins`.

I installed the plugin with this:

```auto
mkdir -p /var/lib/kubelet/volumeplugins/juliohm~cifs
curl -o /var/lib/kubelet/volumeplugins/juliohm~cifs/cifs https://raw.githubusercontent.com/juliohm1978/kubernetes-cifs-volumedriver/master/juliohm%7Ecifs/cifs
chmod +x /var/lib/kubelet/volumeplugins/juliohm~cifs/cifs

```

Then created the secret for the CIFS mount, and a pod with the flex volume mount and all worked.

That’s with Rancher v2.0.6.

---

<div class="post-metadata">

**Author:** ![etlweather](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/etlweather/32/419_2.png) [@etlweather](https://forums.suse.com/u/etlweather)\
**Post date:** [July 31, 2018, 2:34pm UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/4 "2018-07-31T14:34:21Z")

</div>

Note: with `juliohm/kubernetes-cifs-volumedriver` I had issues with the umount not working when deleting a pod. But with [fstab/cifs](https://github.com/fstab/cifs) it works perfectly.

---

<div class="post-metadata">

**Author:** ![Coopyrightdmin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/coopyrightdmin/32/2908_2.png) [@Coopyrightdmin](https://forums.suse.com/u/Coopyrightdmin)\
**Post date:** [October 31, 2018, 8:34am UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/5 "2018-10-31T08:34:00Z")

</div>

Hi,  
I could finally manage it with this driver: [microsoft.com/smb](http://microsoft.com/smb) ([https://github.com/Azure/kubernetes-volume-drivers/tree/master/flexvolume/smb](https://github.com/Azure/kubernetes-volume-drivers/tree/master/flexvolume/smb))

Regards

---

<div class="post-metadata">

**Author:** ![chrisz100](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@chrisz100](https://forums.suse.com/u/chrisz100)\
**Post date:** [April 22, 2020, 2:43pm UTC](https://forums.suse.com/t/adding-custom-driver-to-flex-volume/10578/6 "2020-04-22T14:43:06Z")

</div>

Is there any way to use rke for copying the fstab/cifs files to the master and nodes? Or does this have to be a manual step after using rke to start the cluster?
