You can use NAS file systems as volumes in Kubernetes clusters.

Currently, Apsara File Storage NAS allows you to mount NAS file systems to Kubernetes clusters as follows:
  • Static volumes
    • Mount as volumes
    • Mount through PVs and PVCs
  • Dynamic volumes

Prerequisites

You have created a NAS file system in the NAS console and created a mount target for the file system. The mount target of the file system and your cluster are deployed in the same VPC network. You can log on to the NAS console to create a NAS file system and a mount target.

The mount target is in the following format: 055f84ad83-ixxxx.cn-hangzhou.nas.aliyuncs.com.

Notes

  • Apsara File Storage NAS is a shared storage service. A PVC that is created from a NAS file system can be shared among multiple Pods.
  • Do not delete a mount target if the related NAS file system is not uninstalled. Otherwise, an operating system hang may occur.
  • After a mount target is created, wait until the mount target is ready for use.
  • We recommend that you use NFS v3.
  • We recommend that you upgrade Flexvolume to the latest version before you start using NAS volumes.
  • Speed NAS only supports NFS v3. The nolock option is required.

Scenarios

  • Static volumes

    Apsara File Storage NAS is a shared storage service. You can mount NAS file systems as static volumes to meet the needs of different scenarios.

  • Dynamic volumes

    Use dynamic volumes when you need to mount multiple NAS sub-directories for different applications.

    Use dynamic volumes when you need to deploy SatefulSets and configure multiple NAS volumes for different Pods.

How to mount NAS file systems

We recommend that you use the following methods to mount NAS file systems.

  • Recommended volume plug-in

    We recommend that you use the Flexvolume driver to mount NAS file systems.

    The Flexvolume driver is installed by default when you create a Kubernetes cluster in the console. You need to make sure that the Flexvolume version is up to date. For more information, see Upgrade the Flexvolume driver.

  • Recommended mounting method
    We recommend that you mount NAS file systems through PVs and PVCs. This ensures a flexible structure that is easy to maintain.
  • Unfavorable mounting method

    We recommend that you avoid mounting NAS file systems as volumes. If you have to mount file systems as volumes, you can only use the Flexvolume driver. The native NFS driver provided by Kubernetes is not supported.