ceph-csi/vendor/github.com/kubernetes-csi/drivers/pkg/cinder
2018-07-31 14:53:26 +02:00
..
deploy/kubernetes vendor update for CSI 0.3.0 2018-07-31 14:53:26 +02:00
dockerfile vendor files 2018-01-10 13:42:26 -05:00
etc vendor files 2018-01-10 13:42:26 -05:00
examples/kubernetes vendor files 2018-01-10 13:42:26 -05:00
mount vendor files 2018-01-10 13:42:26 -05:00
openstack vendor files 2018-01-10 13:42:26 -05:00
controllerserver_test.go vendor updates 2018-03-07 11:43:06 -05:00
controllerserver.go vendor updates 2018-03-07 11:43:06 -05:00
driver.go vendor update for CSI 0.3.0 2018-07-31 14:53:26 +02:00
fake.go Updated vednor files 2018-02-15 08:50:31 -05:00
nodeserver_test.go vendor update for CSI 0.3.0 2018-07-31 14:53:26 +02:00
nodeserver.go vendor update for CSI 0.3.0 2018-07-31 14:53:26 +02:00
README.md vendor update for CSI 0.3.0 2018-07-31 14:53:26 +02:00

CSI Cinder driver

Kubernetes

Requirements

The following feature gates and runtime config have to be enabled to deploy the driver.

FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true
RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true"

Mountprogpation requires support for privileged containers. So, make sure privileged containers are enabled in the cluster.

Example local-up-cluster.sh

ALLOW_PRIVILEGED=true FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true" LOG_LEVEL=5 hack/local-up-cluster.sh

Deploy

Encode your cloud.conf file content using base64.

base64 -w 0 cloud.conf

Update cloud.conf configuration in deploy/kubernetes/csi-secret-cinderplugin.yaml file by using the result of the above command.

kubectl -f deploy/kubernetes create

Example Nginx application

kubectl -f examples/kubernetes/nginx.yaml create

Using CSC tool

Start Cinder driver

$ sudo ./_output/cinderplugin --endpoint tcp://127.0.0.1:10000 --cloud-config /etc/cloud.conf --nodeid CSINodeID

Test using csc

Get csc tool from https://github.com/rexray/gocsi/tree/master/csc

Get plugin info

$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"csi-cinderplugin"	"0.1.0"

Create a volume

$ csc controller new --endpoint tcp://127.0.0.1:10000 CSIVolumeName
CSIVolumeID

Delete a volume

$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
CSIVolumeID

ControllerPublish a volume

$ csc controller publish --endpoint tcp://127.0.0.1:10000 --node-id=CSINodeID CSIVolumeID
CSIVolumeID	"DevicePath"="/dev/xxx"

ControllerUnpublish a volume

$ csc controller unpublish --endpoint tcp://127.0.0.1:10000 --node-id=CSINodeID CSIVolumeID
CSIVolumeID

NodePublish a volume

$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/cinder --pub-info DevicePath="/dev/xxx" CSIVolumeID
CSIVolumeID

NodeUnpublish a volume

$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/cinder CSIVolumeID
CSIVolumeID

Get NodeID

$ csc node get-id --endpoint tcp://127.0.0.1:10000
CSINodeID