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
nasplugin.csi.alibabacloud.com can be compiled in a form of a container.
To build a container:
cd build && sh build-nas.shSame as diskplugin.csi.alibabacloud.com;
kubectl apply -f ./examples/nas/pv.yamlkubectl create -f ./deploy/nas/pvc.yamlkubectl create -f ./examples/nas/deploy.yamlCheck status of PVC
kubectl get pvcExpected output:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
nas-pvc Bound nas-csi-pv 5Gi RWO 3m
Check status of PV
kubectl get pvExpected output:
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-pvExpected output:
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: nasplugin.csi.alibabacloud.com
VolumeHandle: data-id
ReadOnly: false
Events: <none>
kubectl get podNAME READY STATUS RESTARTS AGE
deployment-nas-*****-n**** 1/1 Running 0 32s
deployment-nas-*****-4**** 1/1 Running 0 32s
Nas Dynamic: dynamic volume