This topic describes how to use a static NAS volume in the Container Service for Kubernetes (ACK) console.

Background information

  • A static NAS volume is created. For more information, see Manage file systems.
  • A NAS mount target is created. For more information, see Manage mount targets.
    Note

    The NAS mount target and the cluster node must be deployed in the same virtual private cloud (VPC).

Create a PV

  1. Log on to the ACK console.
  2. In the left-side navigation pane, click Clusters.
  3. On the Clusters page, click the name of a cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane, click Persistent Volumes.
  5. Click the Persistent Volumes tab. On the Persistent Volumes tab, click Create in the upper-right corner.
  6. In the Create PV dialog box, configure the parameters.
    Parameter Description
    PV Type You can select Cloud Disk, NAS, or OSS. In this example, select NAS.
    Volume Name The name of the persistent volume (PV). The name must be unique in the namespace. In this example, enter pv-nas.
    Volume Plug-in You can select Flexvolume or CSI. In this example, select CSI.
    Capacity The capacity of the PV. The NAS file system provides unlimited capacity. This parameter does not limit the usage of the NAS file system but defines the capacity of the PV.
    Access Mode You can select ReadWriteMany or ReadWriteOnce. Default value: ReadWriteMany.
    Mount Target Domain Name The mount target of the NAS file system. You can select Select Mount Target or Custom.
    Show Advanced Options
    • Subdirectory: the subdirectory in the NAS file system. The subdirectory must start with a forward slash (/). After you set this parameter, the PV is mounted to the subdirectory.
      • If the specified subdirectory does not exist, the system automatically creates the subdirectory in the NAS file system.
      • This parameter is optional. By default, the PV is mounted to the root directory of the NAS file system.
      • To specify a subdirectory in a NAS Extreme file system, specify a subdirectory that starts with /share.
    • Version: the version of the PV.
    Label Attach labels to the PV.
  7. Click Create.

Create a PVC

  1. Log on to the ACK console.
  2. In the left-side navigation pane, click Clusters.
  3. On the Clusters page, click the name of a cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane, click Persistent Volumes.
  5. On the Persistent Volume Claims tab, click Create in the upper-right corner.
  6. In the Create PVC dialog box, configure the parameters.
    Parameter Description
    PVC Type You can select Cloud Disk, NAS, or OSS. In this example, select NAS.
    Name The name of the persistent volume claim (PVC). The name must be unique in the namespace.
    Allocation Mode In this example, select Existing Volumes.
    Note If no PV is created, you can set Allocation Mode to Create Volume. For information about how to configure PV parameters, see Create a PV.
    Existing Volumes Click Select PV. Find the PV that you want to use and click Select in the Actions column.
    Capacity The capacity of the PVC.
    Note The capacity of the PVC cannot exceed the capacity of the PV to be bound to this PVC.
  7. Click Create.
    After you create the PVC, you can find it on the Persistent Volume Claims tab. In this example, a PVC named csi-nas-pvc is created and a PV is bound to the PVC.

Create an application

  1. Log on to the ACK console.
  2. In the left-side navigation pane, click Clusters.
  3. On the Clusters page, click the name of a cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane, click Workload.
  5. On the Deployments tab, click Create from Image.
  6. On the Basic Information wizard page, configure basic settings.
    Basic settings
    Parameter Description
    Name The name of the application.
    Namespace The namespace in which the application is deployed. If you do not set this field, the system uses the default namespace.
    Replicas The number of pods in an application. Default value: 2.
    Type The type of the application. You can select Deployments, StatefulSets, Jobs, Cron Jobs, and DaemonSets.
    Label Add one or more labels to the application.
    Annotations Add one or more annotations to the application.
    Synchronize Timezone Specify whether to synchronize the timezone from nodes to containers.
    Note In this example, Deployments is selected as the application type.
  7. Click Next.
  8. Configure the container parameters.
    This example describes how to configure the volume parameters. For more information about other parameters, see Use an image to create a stateless application.
    You can add local volumes and cloud volumes.
    • Local storage: You can select HostPath, ConfigMap, Secret, or EmptyDir from the PV Type drop-down list. Then, specify Mount Source and Container Path to mount a source path to a container path. For more information, see Volumes.
    • Cloud storage: You can add cloud volumes.
    In this example, specify csi-nas-pvc as Mount Source and mount it to the /tmp path in the container.volume
  9. Click Next.
  10. Set other parameters and click Create.
    After you create the application, you can use the NAS volume in the application.

You can also use a static NAS volume by running commands. For more information, see Use a static NAS volume through YAML.