Apsara File Storage NAS (NAS) is a distributed file system that supports shared access, elastic scaling, high reliability, and high performance. This topic describes how to mount a statically provisioned NAS volume, and how to enable persistent storage and shared storage by using a statically provisioned NAS volume.
Prerequisites
- A Container Service for Kubernetes (ACK) cluster is created. For more information, see Create an ACK managed cluster.
- A NAS file system is created. For more information, see Create a NAS file system.
If you want to encrypt data in a NAS volume, configure the encryption settings when you create the NAS file system.
- A mount target is created for the NAS file system. For more information, see Manage mount targets.
The mount target and the cluster node to which you want to mount the NAS file system must belong to the same virtual private cloud (VPC).
- A kubectl client is connected to the cluster. For more information, see Connect to ACK clusters by using kubectl.
Scenarios:
- Your application requires high disk I/O.
- You need a storage service that offers higher read and write throughput than Object Storage Service (OSS).
- You want to share files across hosts. For example, you want to use a NAS file system as a file server.
Precautions
- To mount an Extreme NAS file system, set the
path
parameter of the NAS volume to a subdirectory of /share. For example, you can specify the /share/path1 subdirectory when you mount an Extreme NAS file system to a pod. - If a NAS file system is mounted to multiple pods, the data in the file system is shared
by the pods. In this case, the application must be able to synchronize data across
these pods when data modifications are made by multiple pods.
Note You cannot grant permissions to access the / directory (root directory) of the NAS file system. The user account and user group to which the directory belongs cannot be modified.
- If the securityContext.fsgroup parameter is set in the application template, kubelet performs the
chmod
orchown
operation after the volume is mounted, which increases the time consumption.Note For more information about how to speed up the mounting process when the securityContext.fsgroup parameter is set, see Why does it require a long time to mount a NAS volume?.
Mount a statically provisioned NAS volume in the console
Step 1: Create a PV
Step 2: Create a PVC
Step 3: Create an application