NAS is a distributed file system that provides shared access, scalability, high reliability, and high performance. This topic describes how to mount a statically provisioned NAS volume on an RDS Custom container series node to implement persistent storage and shared storage.
Prerequisites
Create an RDS Custom container series AI node.
Step 1: Create a NAS file system
For detailed operations, see Create a file system.
You must create a NAS file system in the region where the RDS Custom container series node is located.
Both General-purpose NAS file system and Extreme NAS file system are supported. Choose based on your requirements.
If you use an existing NAS file system, make sure that it meets the following requirements. Otherwise, create a new NAS file system.
The Protocol Type is NFS.
The mount target and the RDS Custom container series node are in the same VPC, and the Status is Active. To add a mount target, see Manage mount targets.
When you create a General-purpose NAS file system, you can configure the VPC and vSwitch for the mount target. For an Extreme NAS file system, you need to add a mount target after creation and specify the VPC and vSwitch for the mount target.
A NAS file system can be mounted only on pods in the same VPC. Cross-VPC mounting is not supported. Within the same VPC, NAS can be mounted across zones.
NoteTo encrypt data in the NAS volume, configure the encryption type when you create the NAS file system.
Obtain the mount target address.
On the File System List page, find the target file system, click the Operation column's Mount to view the mount target address of the target file system. For example:
General-purpose NAS:
153f****.cn-beijing.nas.aliyuncs.comExtreme NAS:
162d****.cn-beijing.extreme.nas.aliyuncs.com
Step 2: Create a statically provisioned PV
Execute the following command to create a statically provisioned PV.
kubectl create -f pv-nas.yamlSome parameter requirements are as follows:
server: The mount address of the target NAS.
path: The subdirectory where the NAS volume is mounted in the container. The parent directory for General-purpose NAS is
/. The parent directory for Extreme NAS is /share.For example, the subdirectory for General-purpose NAS can be set to
/csi, and the subdirectory for Extreme NAS can be set to/share/csi.volumeHandle: The instance ID of the target NAS.
Example files:
General-purpose NAS
The following is an example file pv-nas-normal for creating a statically provisioned PV.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nas-normal
labels:
alicloud-pvname: pv-nas-normal
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 1Ti
csi:
driver: nasplugin.csi.alibabacloud.com
volumeAttributes:
server: 153f****.cn-beijing.nas.aliyuncs.com
path: /csi
volumeHandle: 153f94****Extreme NAS
The following is an example file pv-nas-extreme for creating a statically provisioned PV.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nas-extreme
labels:
alicloud-pvname: pv-nas-extreme
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 1Ti
csi:
driver: nasplugin.csi.alibabacloud.com
volumeAttributes:
server: 01ac****.cn-beijing.extreme.nas.aliyuncs.com
path: /share
volumeHandle: extreme-01ac****Step 3: Create a persistent volume claim PVC
Execute the following command to create a persistent volume claim (PVC).
kubectl create -f pvc-nas.yamlExample files:
General-purpose NAS
The following is an example file pvc-nas-normal for creating a persistent volume claim (PVC).
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-nas-normal
spec:
volumeName: pv-nas-normal
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1TiExtreme NAS
The following is an example file pvc-nas-extreme for creating a persistent volume claim (PVC).
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-nas-extreme
spec:
volumeName: pv-nas-extreme
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1TiStep 4: Deploy a pod and mount the PVC
Execute the following command to deploy a pod and mount the PVC.
kubectl apply -f pod.yamlExample files:
General-purpose NAS
The following is an example file sglang-qwen3-nas-normal for deploying a pod.
# Pod configuration
apiVersion: v1
kind: Pod
metadata:
name: sglang-qwen3-nas-normal
spec:
containers:
- command:
- sh
- -c
- echo hello world; sleep infinity;
image: aliclouddb-pub-registry-vpc.cn-beijing.cr.aliyuncs.com/aliclouddb-public/des-ai-nv:25.05-sglang0.4.6.post4-pytorch2.6-cu124-20250513-serverless
imagePullPolicy: IfNotPresent
name: sglang
ports:
- containerPort: 8000
name: restful
protocol: TCP
resources:
requests:
cpu: "40"
memory: "300Gi"
limits:
cpu: "40"
memory: "300Gi"
volumeMounts:
- name: nas-normal-volume
mountPath: "/nas"
volumes:
- name: nas-normal-volume
persistentVolumeClaim:
claimName: pvc-nas-normal
restartPolicy: Always
nodeSelector:
alibabacloud.com/virtual-node: "true"
tolerations:
- effect: NoSchedule
key: virtual-kubelet.io/provider
value: aliclouddbExtreme NAS
The following is an example file sglang-qwen3-nas-extreme for deploying a pod.
# Pod configuration
apiVersion: v1
kind: Pod
metadata:
name: sglang-qwen3-nas-extreme
spec:
containers:
- command:
- sh
- -c
- echo hello world; sleep infinity;
image: aliclouddb-pub-registry-vpc.cn-beijing.cr.aliyuncs.com/aliclouddb-public/des-ai-nv:25.05-sglang0.4.6.post4-pytorch2.6-cu124-20250513-serverless
imagePullPolicy: IfNotPresent
name: sglang
ports:
- containerPort: 8000
name: restful
protocol: TCP
resources:
requests:
cpu: "40"
memory: "300Gi"
limits:
cpu: "40"
memory: "300Gi"
volumeMounts:
- name: nas-normal-volume
mountPath: "/nas"
volumes:
- name: nas-normal-volume
persistentVolumeClaim:
claimName: pvc-nas-extreme
restartPolicy: Always
nodeSelector:
alibabacloud.com/virtual-node: "true"
tolerations:
- effect: NoSchedule
key: virtual-kubelet.io/provider
value: aliclouddbStep 5: Verify the mount result
Execute the following command to verify the mount result.
kubectl exec <pod name> -- df -h /nasExample:
kubectl exec sglang-qwen3-nas-extreme -- df -h /nas
Filesystem Size Used Avail Use% Mounted on
0162d****.cn-beijing.extreme.nas.aliyuncs.com:/share 99G 134M 99G 1% /nas