Create a persistent volume (PV)

更新时间:
复制 MD 格式

You can create a persistent volume (PV) using a YAML file or the console.

Note

In the Agile Platform as a Service (PaaS) base environment, AKS is not integrated with Alibaba Cloud NAS or cloud disk storage. To use the storage feature, you must install a third-party storage plugin.

Prerequisites

A StorageClass is created.

Procedure

  1. Log on to the Containerized Application Service console. In the navigation pane on the left, click Storage > PersistentVolume.

  2. On the Persistent Volumes page, click Create Persistent Volume.

  3. In the text box, enter the content in YAML format and click Submit.

    Example:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv-nas
      labels:
        alicloud-pvname: pv-nas
    spec:
      capacity:
        storage: 5Gi
      accessModes:
        - ReadWriteMany
      csi:
        driver: nasplugin.csi.alibabacloud.com
        volumeHandle: pv-nas
        volumeAttributes:
          server: "2564f4****-ysu87.cn-shenzhen.nas.aliyuncs.com"
          path: "/csi"
      mountOptions:
      - nolock,tcp,noresvport
      - vers=3

    Parameters

    Parameter

    Description

    driver

    The driver type.

    volumeHandle

    The name of the PV.

    server

    The NAS mount target.

    path

    The mount subdirectory. For Extreme NAS, the path must start with /share.

    vers

    The version number of the NFS protocol used to mount the NAS volume. Use v3 because Extreme NAS supports only v3.