Skip to content

Build a custom Dell CSI Driver

With all the Dell CSI drivers and dependencies being open-source, anyone can tweak them to fit a specific use case.

This article demonstrates creating a patched version of a Dell CSI Driver for PowerScale.

The premise

As a practical example, the following steps indicate how to create a patched version of Dell CSI Driver for PowerScale that supports a longer mounted path.

The CSI Specification defines that a driver must accept a max path 128 bytes minimal.

Dell drivers use the library gocsi as a common boilerplate for CSI development. That library enforces the 128 bytes maximum path length .

The PowerScale hardware supports path length up to 1023 characters as described in the PowerScale spec. Therefore, we will build a csi-powerscale driver that supports that maximum length path value.

Steps to patch a driver

Dependencies

The pre-requisites are:

  • Golang (v1.16 minimal)
  • Podman or Docker
  • Optionally make to run the Makefile

Clone, Branch & Patch

Clone the official csi-powerscale repository:

cd $GOPATH/src/github.com/
git clone git@github.com:dell/csi-powerscale.git dell/csi-powerscale
cd dell/csi-powerscale
git checkout v2.1.0 -b v2.1.0-longer-path

Fork gocsi on GitHub

Fork and clone the gocsi library:

cd $GOPATH/src/github.com/
git clone git@github.com:coulof/gocsi.git coulof/gocsi
cd coulof/gocsi
git remote add upstream git@github.com:dell/gocsi.git
git checkout v1.5.0 -b v1.5.0-longer-path

Apply the patch:

--- a/middleware/specvalidator/spec_validator.go
+++ b/middleware/specvalidator/spec_validator.go
@@ -770,7 +770,7 @@ const (
-       maxFieldString = 128
+       maxFieldString = 1023

Build

Update go.mod to use the patched library:

replace (
+       github.com/dell/gocsi => github.com/coulof/gocsi v1.5.0-longer-path

Build the binary: make build

Build the image:

cat << EOF > Dockerfile.patch
FROM dellemc/csi-isilon:v2.1.0
COPY "csi-isilon" .
EOF

docker build -t coulof/csi-isilon:v2.1.0-long-path -f Dockerfile.patch .
docker push coulof/csi-isilon:v2.1.0-long-path

Update CSI Kubernetes deployment

If using helm, add to myvalues.yaml:

images:
  driver: docker.io/coulof/csi-powerscale:v2.1.0-long-path

Or patch existing deployment:

kubectl patch deployment -n powerscale isilon-controller \
  --patch-file path_csi-isilon_controller_image.yaml

Wrap-up & disclaimer

Thanks to open-source it is easy to fix and improve Dell CSI drivers or Dell Container Storage Modules .

Keep in mind that Dell officially supports the published images and binaries; not custom builds.