mirror of
https://github.com/kubernetes-csi/csi-driver-nvmf.git
synced 2025-04-28 03:11:45 +00:00
CSI driver NVMf mainly supports RDMA and TCP for Software Defined Storage by NVMf
|
||
---|---|---|
cmd/nvmfplugin | ||
deploy/kubernetes | ||
examples/kubernetes/example | ||
pkg | ||
.gitignore | ||
code-of-conduct.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
OWNERS | ||
OWNERS_ALIASES | ||
README.md | ||
SECURITY_CONTACTS |
CSI NVMf driver
Overview
This is a repository for NVMe-oF CSI Driver. Currently it implements bare minimum of th CSI spec.
Requirements
The CSI NVMf driver requires initiator and target kernel versions to be Linux kernel 5.0 or newer. Before using this csi driver, you should create a NVMf remote disk on the target side and record traddr/trport/trtype/nqn/deviceuuid.
Modprobe Nvmf mod on Initiator/Target
# when use TCP as transport
$ modprobe nvme-tcp
# when use RDMA as transport
$ modprobe nvme-rdma
Start NVMf driver
$ ./output/nvmfplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode
Test NVMf driver using csc
Get csc tool from https://github.com/rexray/gocsi/tree/master/csc
$ go get github.com/rexray/gocsi/csc
Get plugin info
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"csi.nvmf.com" "v1.0.0"
NodePublish a volume
$ export TargetTrAddr="NVMf Target Server IP (Ex: 192.168.122.18)"
$ export TargetTrPort="NVMf Target Server Ip Port (Ex: 49153)"
$ export TargetTrType="NVMf Target Type (Ex: tcp | rdma)"
$ export DeviceUUID="NVMf Target Device UUID (Ex: 58668891-c3e4-45d0-b90e-824525c16080)"
$ export NQN="NVMf Target NQN"
$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nvmf --attrib targetTrAddr=$TargetTrAddr
--attrib targetTrPort=$TargetTrPort --attrib targetTrType=$TargetTrType
--attrib deviceUUID=$DeviceUUID --attrib nqn=$NQN nvmftestvol
nvmftestvol
You can find a new disk on /mnt/nvmf
NodeUnpublish a volume
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nvmf nvmftestvol
nvmftestvol
Test NVMf driver in kubernetes cluster
- TODO: because remote disk creation requires a controller.
Installation
$ kubectl create -f deploy/kubernetes/
Uninstallation
$ kubectl delete -f deploy/kubenetes/
Create Storage Class
- Create
$ kubectl create -f examples/kubernetes/example/storageclass.yaml
- Check
$ kubectl get sc
Create PV
- Create
$ kubectl create -f examples/kubernetes/example/pv.yaml
- Check
$ kubectl get pv
Mount Volume
- Create Deployment
$ kubectl create -f examples/kubernetes/example/nginx.yaml
- Check
$ kubectl exec -it nginx-451df123421 /bin/bash
$ lsblk
Community,discussion,contribution,and support
You can reach the maintainers of this project at:
Code of conduct
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.