Alicloud CSI plugins implement an interface between CSI enabled Container Orchestrator and AliCloud Storage. It allows dynamically provision Disk volumes and attach it to workloads. Current implementation of CSI plugins was tested in Kubernetes environment (requires Kubernetes 1.10+).
Current Support: Alicloud Disk, OSS, NAS;
An Disk CSI plugin is available to help simplify storage management. Once user creates PVC with the reference to a Disk storage class, disk and corresponding PV object gets dynamically created and becomes ready to be used by workloads.
- Secret object with the authentication key for Disk
- StorageClass with diskplugin (default csi-diskplugin name) as a provisioner name and information about disk(zoneId, regionId, type)
- Service Accounts with required RBAC permissions
Alpha
csi-diskplugin can be compiled in a form of a container.
To build a container:
$ cd build && sh build-disk.sh
You can create a Kubernetes Cluster on Alicloud Container Service
Set --enable-controller-attach-detach=true for kubelet:
# vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
Kubernetes default to true if you use Kubeadm to create Cluster, Alicloud set it to false for the Flexvolume feature; If you want to use Flexvolume, set it to false again;
# kubectl create -f ./deploy/disk/diskattacher.yaml
# kubectl create -f ./deploy/disk/diskprovisioner.yaml
# kubectl create -f ./deploy/disk/diskplugin.yaml
# kubectl create -f ./deploy/disk/storageclass.yaml
Important: storageclass.yaml, must be customized to match your environment: zoneId, zoneId;
# kubectl get pods | grep csi
The following output should be displayed:
NAME READY STATUS RESTARTS AGE
csi-attacher-0 1/1 Running 11 2d
csi-diskplugin-568pb 2/2 Running 0 19h
csi-diskplugin-f4tsn 2/2 Running 0 19h
csi-diskplugin-rq8tj 2/2 Running 0 19h
csi-diskplugin-tc6rj 2/2 Running 0 19h
csi-provisioner-0 1/1 Running 0 2d
# kubectl create -f ./deploy/disk/deploy.yaml
# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
disk-pvc Bound pvc-64b3d1bd-96c0-11e8-89b1-00163e0c412f 25Gi RWO csi-disk 36m
# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-64b3d1bd-96c0-11e8-89b1-00163e0c412f 25Gi RWO Delete Terminating default/disk-pvc csi-disk 35m
# kubectl describe pv pvc-64b3d1bd-96c0-11e8-89b1-00163e0c412f
Name: pvc-64b3d1bd-96c0-11e8-89b1-00163e0c412f
Labels: <none>
Annotations: pv.kubernetes.io/provisioned-by=csi-diskplugin
Finalizers: [kubernetes.io/pv-protection external-attacher/csi-diskplugin]
StorageClass: csi-disk
Status: Terminating (lasts 2m)
Claim: default/disk-pvc
Reclaim Policy: Delete
Access Modes: RWO
Capacity: 25Gi
Node Affinity: <none>
Message:
Source:
Type: CSI (a Container Storage Interface (CSI) volume source)
Driver: csi-diskplugin
VolumeHandle: d-2ze47lce65lv5g7zsb4y
ReadOnly: false
Events: <none>
# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-deployment1-5879d9db88-49n8m 1/1 Running 0 37m
An NAS CSI plugin is available to help simplify storage management. You can create a pv with csi configuration, and the pvc, pod defines as usual.
- Service Accounts with required RBAC permissions
Alpha
csi-nasplugin can be compiled in a form of a container.
To build a container:
$ cd build && sh build-nas.sh
Same as csi-diskplugin;
# kubectl create -f ./deploy/nas/nasattacher.yaml
# kubectl create -f ./deploy/nas/nasplugin.yaml
# kubectl create -f ./deploy/nas/deploy.yaml
# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
nas-pvc Bound nas-csi-pv 5Gi RWO 3m
# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
nas-csi-pv 5Gi RWO Retain Bound default/nas-pvc 3m
# kubectl describe pv nas-csi-pv
Name: nas-csi-pv
Labels: <none>
Annotations: pv.kubernetes.io/bound-by-controller=yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass:
Status: Bound
Claim: default/nas-pvc
Reclaim Policy: Retain
Access Modes: RWO
Capacity: 5Gi
Node Affinity: <none>
Message:
Source:
Type: CSI (a Container Storage Interface (CSI) volume source)
Driver: csi-nasplugin
VolumeHandle: data-id
ReadOnly: false
Events: <none>
An OSS CSI plugin is available to help simplify storage management. You can create a pv with csi configuration, and the pvc, pod defines as usual.
- Service Accounts with required RBAC permissions
Alpha
csi-ossplugin can be compiled in a form of a container.
To build a container:
$ cd build && sh build-oss.sh
Same as csi-diskplugin;
# kubectl create -f ./deploy/oss/ossattacher.yaml
# kubectl create -f ./deploy/oss/ossplugin.yaml
# kubectl create -f ./deploy/oss/deploy.yaml
# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
oss-pvc Bound oss-csi-pv 5Gi RWO 1m
# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
oss-csi-pv 5Gi RWO Retain Bound default/oss-pvc 1m
# kubectl describe pv oss-csi-pv
Name: oss-csi-pv
Labels: <none>
Annotations: pv.kubernetes.io/bound-by-controller=yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass:
Status: Bound
Claim: default/oss-pvc
Reclaim Policy: Retain
Access Modes: RWO
Capacity: 5Gi
Node Affinity: <none>
Message:
Source:
Type: CSI (a Container Storage Interface (CSI) volume source)
Driver: csi-ossplugin
VolumeHandle: data-id
ReadOnly: false
Events: <none>
Please submit an issue at: Issues