Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Container Engine_Autopilot/ User Guide/ Storage/ EVS Volumes/ Using an EVS Disk Through a Dynamic PV

Using an EVS Disk Through a Dynamic PV

Updated on 2025-02-27 GMT+08:00

CCE Autopilot allows you to dynamically create storage volumes from EVS disks by specifying a StorageClass when no EVS disks are available.

Prerequisites

  • You have created a cluster.
  • If you want to create a cluster by running commands, kubectl has been used to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.

Constraints

  • Not all regions support EVS volumes. View the regions where EVS volumes are supported on the console. You can also view Function Overview to learn about all regions where EVS volumes are supported.
  • EVS disks cannot be used by multiple workloads, multiple pods of the same workload, or multiple tasks. If EVS disks are used when you create a Deployment, select only one pod for the Deployment.
  • The cluster version must be v1.27.8-r0, v1.28.6-r0, or later. If the cluster version does not meet the requirements, you need to upgrade the cluster.
  • No more than 10 EVS disks can be attached to each workload in a cluster. If more than 10 EVS disks are attached, the workload may run abnormally.
  • Resource tags can be added to dynamically created EVS disks. After they are created, the resource tags cannot be updated on the CCE console. To update them, go to the EVS console. If you use an existing EVS disk to create a PV, you also need to add or update resource tags on the EVS console.

Dynamically Creating EVS Volumes

Specify StorageClass to automatically create EVS disks and storage volumes and mount the volumes to workloads for persistent storage on the console or using kubectl.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. Dynamically create a PVC and PV.

    1. In the navigation pane on the left, choose Storage. Then click the PVCs tab. In the upper right corner, click Create PVC. In the displayed dialog box, configure the parameters.
      Figure 1 Creating a PVC

      Parameter

      Description

      PVC Type

      In this example, select EVS.

      PVC Name

      Enter the PVC name, which must be unique in the same namespace.

      Namespace

      A namespace is a conceptual grouping of resources or objects. Each namespace provides isolation for data from other namespaces.

      After a cluster is created, the default namespace is created by default. If there is no special requirement, select the default namespace.

      Creation Method

      • If no underlying storage is available, select Dynamically provision to create a PVC, PV, and underlying storage on the console in cascading mode.
      • If underlying storage is available, select either Use existing or Create new. For details about static creation, see Using an Existing EVS Disk Through a Static PV.

      In this example, select Dynamically provision.

      Storage Classes

      The StorageClass for EVS volumes is csi-disk.

      (Optional) PV Name Prefix

      This parameter specifies the name of the underlying storage that is automatically created. The actual underlying storage name is in the format of "PV name prefix + PVC UID". If this parameter is left blank, the default prefix pvc will be used.

      For example, if the storage volume name prefix is set to test, the actual underlying storage name is test-{UID}.

      AZ

      Select the AZ of the EVS disk. After the EVS disk is created, the AZ cannot be changed.

      In this example, select AZ3.

      Disk Type

      Select an EVS disk type. EVS disk types vary depending on regions. Obtain the available EVS types on the console.

      In this example, select High I/O.

      NOTE:

      General-purpose SSD V2 disks allow you to specify the disk IOPS and throughput. For details, see EVS performance data.

      Capacity (GiB)

      Capacity of the requested storage volume.

      Set it to 10 in this example.

      Access Mode

      EVS volumes support only ReadWriteOnce, indicating that a storage volume can only be mounted to one pod in read/write mode. For details, see Volume Access Modes.

      Encryption

      Configure whether to encrypt underlying storage. If you select Enabled (key), an encryption key must be configured. Currently, encryption is not supported.

      Enterprise Project

      The default enterprise project, the enterprise project to which the cluster belongs, or the enterprise project specified by StorageClass is available.

      Resource Tag

      You can add resource tags to classify resources.

      You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

      CCE automatically creates system tags CCE-Cluster-ID={Cluster ID}, CCE-Cluster-Name={Cluster name}, and CCE-Namespace={Namespace name}. These tags cannot be modified.

      NOTE:

      After a dynamic PV of the EVS type is created, the resource tags cannot be updated on the CCE console. To update these resource tags, go to the EVS console.

    2. Click Create.

      In the navigation pane on the left, choose Storage. View the created PVC and PV on the PVCs and PVs tabs, respectively.

  3. Create a workload.

    1. In the navigation pane on the left, choose Workloads. Then click the StatefulSets tab.
    2. In the upper right corner, click Create Workload. On the displayed page, click Data Storage in the Container Settings area and click Add Volume to select PVC.

      Table 1 describes the parameters for mounting the volume. For details about other parameters, see Workloads.

      In this example, the volume is mounted to the /data path of the container. The container data generated in this path is stored in the EVS disk.

      NOTE:

      A non-shared EVS disk can be mounted to only one pod. If there are multiple pods, extra pods cannot start normally. Ensure that the number of pods for running a workload is 1 if an EVS disk is mounted.

      Figure 2 Parameters for mounting a storage volume
      Table 1 Parameters for mounting a storage volume

      Parameter

      Description

      PVC

      Select an existing EVS volume.

      An EVS volume can only be mounted to one workload.

      Mount Path

      Enter a mount path, for example, /data.

      This parameter indicates the container path that the volume will be mounted to. Do not mount the volume to a system directory such as / or /var/run. This may cause container errors. Mount the volume to an empty directory. If the directory is not empty, ensure that there are no files that affect container startup. If there are such files, they will be replaced, which will lead to a container startup or workload creation failure.
      NOTICE:

      If a volume is mounted to a high-risk directory, use an account with minimum permissions to start the container, or high-risk files on the host may be damaged.

      Subpath

      Enter the subpath of the storage volume and mount a path in the storage volume to the container. In this way, different folders of the same storage volume can be used in a single pod. data, for example, indicates that data in the mount path of the container is stored in the data directory of the storage volume. If this parameter is left blank, the root path is used by default.

      Permission

      • Read-only: You can only read the data in the mounted volume.
      • Read-write: You can modify the volume mounted to the path. Newly written data will not be migrated if the container is migrated, which may cause data loss.
    3. Configure other parameters and click Create Workload.

      After the workload is created, the data in the container mount directory will be persistently stored. Verify the storage by referring to Verifying Data Persistence.

  1. Use kubectl to connect to the cluster.
  2. Use StorageClass to dynamically create a PVC and PV.

    1. Create the pvc-evs-auto.yaml file.
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: pvc-evs-auto
        namespace: default
        annotations:
            everest.io/disk-volume-type: SAS    # EVS disk type
          everest.io/enterprise-project-id: <your_project_id>  # (Optional) Enterprise project ID. If an enterprise project is specified, use the same enterprise project when creating a PVC. Otherwise, the PVC cannot be bound to a PV.
      
          everest.io/disk-volume-tags: '{"key1":"value1","key2":"value2"}' # (Optional) Custom resource tags
      
          everest.io/disk-iops: '3000'      # (Optional) IOPS of only a GPSSD2 EVS disk
          everest.io/disk-throughput: '125' # (Optional) Throughput of only a GPSSD2 EVS disk
      
          everest.io/csi.volume-name-prefix: test  # (Optional) Storage volume name prefix of the automatically created underlying storage
      
        labels:
          failure-domain.beta.kubernetes.io/region: <your_region>   # Replace the region with the one where the cluster is located.
          failure-domain.beta.kubernetes.io/zone: <your_zone>       # Replace the AZ with the one where the EVS disk is located.
      spec:
        accessModes:
        - ReadWriteOnce               # The value must be ReadWriteOnce for EVS disks.
        resources:
          requests:
            storage: 10Gi             # EVS disk capacity, in GiB. The value ranges from 1 to 32768.
        storageClassName: csi-disk    # The StorageClass of the EVS disk
      Table 2 Key parameters

      Parameter

      Mandatory

      Description

      failure-domain.beta.kubernetes.io/region

      Yes

      Region of the cluster.

      For example, cn-east-3. For details, see Regions and Endpoints.

      failure-domain.beta.kubernetes.io/zone

      Yes

      AZ of the EVS disk.

      You can obtain all supported AZs by querying the AZ list.

      everest.io/disk-volume-type

      Yes

      EVS disk type. All letters are in uppercase. EVS disk types vary depending on regions. Obtain the available EVS types on the console.
      • SAS: high I/O
      • SSD: ultra-high I/O
      • GPSSD: general-purpose SSD
      • ESSD: extreme SSD
      • GPSSD2: general-purpose SSD v2. You need to specify the everest.io/disk-iops and everest.io/disk-throughput annotations.

      everest.io/disk-iops

      No

      Preconfigured IOPS, which is supported only by general-purpose SSD v2 EVS disks.
      • The IOPS of general-purpose SSD v2 EVS disks ranges from 3000 to 128000, and the maximum value is 500 times of the capacity (GiB).

        If the IOPS of general-purpose SSD v2 disks is greater than 3000, extra IOPS will be billed. For details, see Price Calculator.

      everest.io/disk-throughput

      No

      Preconfigured throughput, which is supported only by general-purpose SSD v2 EVS disks.

      The value ranges from 125 MiB/s to 1,000 MiB/s. The maximum value is a quarter of IOPS.

      If the throughput is greater than 125 MiB/s, extra throughput will be billed. For details, see Price Calculator.

      everest.io/enterprise-project-id

      No

      Enterprise project ID of the EVS disk. This parameter is optional. If an enterprise project is specified, use the same enterprise project when creating a PVC, or the PVC cannot be bound to a PV.

      To obtain an enterprise project ID, log in to the EPS console, click the name of the target enterprise project, and copy the enterprise project ID.

      everest.io/disk-volume-tags

      No

      You can add resource tags to classify resources. This field is optional.

      You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

      CCE automatically creates system tags CCE-Cluster-ID={Cluster ID}, CCE-Cluster-Name={Cluster name}, and CCE-Namespace={Namespace name}. These tags cannot be modified.

      everest.io/csi.volume-name-prefix

      No

      This parameter is optional. It specifies the name of the underlying storage that is automatically created. The actual underlying storage name is in the format of "PV name prefix + PVC UID". If this parameter is left blank, the default prefix pvc will be used.

      Enter 1 to 26 characters that cannot start or end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

      For example, if the storage volume name prefix is set to test, the actual underlying storage name is test-{UID}.

      storage

      Yes

      Requested PVC capacity, in Gi. The value ranges from 1 to 32768.

      storageClassName

      Yes

      The StorageClass for EVS volumes is csi-disk.

    2. Run the following command to create a PVC:
      kubectl apply -f pvc-evs-auto.yaml

  3. Create a workload.

    1. Create a file named web-evs-auto.yaml. In this example, the EVS volume is mounted to the /data path.
      apiVersion: apps/v1
      kind: StatefulSet
      metadata:
        name: web-evs-auto
        namespace: default
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: web-evs-auto
        serviceName: web-evs-auto   # Headless Service name
        template:
          metadata:
            labels:
              app: web-evs-auto
          spec:
            containers:
            - name: container-1
              image: nginx:latest
              volumeMounts:
              - name: pvc-disk    # Volume name, which must be the same as the volume name in the volumes field.
                mountPath: /data  #Location where the storage volume is mounted.
            imagePullSecrets:
              - name: default-secret
            volumes:
              - name: pvc-disk    # Custom volume name
                persistentVolumeClaim:
                  claimName: pvc-evs-auto    # Name of the created PVC.
      ---
      apiVersion: v1
      kind: Service
      metadata:
        name: web-evs-auto   # Headless Service name
        namespace: default
        labels:
          app: web-evs-auto
      spec:
        selector:
          app: web-evs-auto
        clusterIP: None
        ports:
          - name: web-evs-auto
            targetPort: 80
            nodePort: 0
            port: 80
            protocol: TCP
        type: ClusterIP
    2. Run the following command to create a workload that the EVS volume is mounted to:
      kubectl apply -f web-evs-auto.yaml

      After the workload is created, the data in the container mount directory will be persistently stored. Verify the storage by referring to Verifying Data Persistence.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. Dynamically create a PVC and PV.

    1. In the navigation pane on the left, choose Storage. Then click the PVCs tab. In the upper right corner, click Create PVC. In the displayed dialog box, configure the parameters.
      Figure 1 Creating a PVC

      Parameter

      Description

      PVC Type

      In this example, select EVS.

      PVC Name

      Enter the PVC name, which must be unique in the same namespace.

      Namespace

      A namespace is a conceptual grouping of resources or objects. Each namespace provides isolation for data from other namespaces.

      After a cluster is created, the default namespace is created by default. If there is no special requirement, select the default namespace.

      Creation Method

      • If no underlying storage is available, select Dynamically provision to create a PVC, PV, and underlying storage on the console in cascading mode.
      • If underlying storage is available, select either Use existing or Create new. For details about static creation, see Using an Existing EVS Disk Through a Static PV.

      In this example, select Dynamically provision.

      Storage Classes

      The StorageClass for EVS volumes is csi-disk.

      (Optional) PV Name Prefix

      This parameter specifies the name of the underlying storage that is automatically created. The actual underlying storage name is in the format of "PV name prefix + PVC UID". If this parameter is left blank, the default prefix pvc will be used.

      For example, if the storage volume name prefix is set to test, the actual underlying storage name is test-{UID}.

      AZ

      Select the AZ of the EVS disk. After the EVS disk is created, the AZ cannot be changed.

      In this example, select AZ3.

      Disk Type

      Select an EVS disk type. EVS disk types vary depending on regions. Obtain the available EVS types on the console.

      In this example, select High I/O.

      NOTE:

      General-purpose SSD V2 disks allow you to specify the disk IOPS and throughput. For details, see EVS performance data.

      Capacity (GiB)

      Capacity of the requested storage volume.

      Set it to 10 in this example.

      Access Mode

      EVS volumes support only ReadWriteOnce, indicating that a storage volume can only be mounted to one pod in read/write mode. For details, see Volume Access Modes.

      Encryption

      Configure whether to encrypt underlying storage. If you select Enabled (key), an encryption key must be configured. Currently, encryption is not supported.

      Enterprise Project

      The default enterprise project, the enterprise project to which the cluster belongs, or the enterprise project specified by StorageClass is available.

      Resource Tag

      You can add resource tags to classify resources.

      You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

      CCE automatically creates system tags CCE-Cluster-ID={Cluster ID}, CCE-Cluster-Name={Cluster name}, and CCE-Namespace={Namespace name}. These tags cannot be modified.

      NOTE:

      After a dynamic PV of the EVS type is created, the resource tags cannot be updated on the CCE console. To update these resource tags, go to the EVS console.

    2. Click Create.

      In the navigation pane on the left, choose Storage. View the created PVC and PV on the PVCs and PVs tabs, respectively.

  3. Create a workload.

    1. In the navigation pane on the left, choose Workloads. Then click the StatefulSets tab.
    2. In the upper right corner, click Create Workload. On the displayed page, click Data Storage in the Container Settings area and click Add Volume to select PVC.

      Table 1 describes the parameters for mounting the volume. For details about other parameters, see Workloads.

      In this example, the volume is mounted to the /data path of the container. The container data generated in this path is stored in the EVS disk.

      NOTE:

      A non-shared EVS disk can be mounted to only one pod. If there are multiple pods, extra pods cannot start normally. Ensure that the number of pods for running a workload is 1 if an EVS disk is mounted.

      Figure 2 Parameters for mounting a storage volume
      Table 1 Parameters for mounting a storage volume

      Parameter

      Description

      PVC

      Select an existing EVS volume.

      An EVS volume can only be mounted to one workload.

      Mount Path

      Enter a mount path, for example, /data.

      This parameter indicates the container path that the volume will be mounted to. Do not mount the volume to a system directory such as / or /var/run. This may cause container errors. Mount the volume to an empty directory. If the directory is not empty, ensure that there are no files that affect container startup. If there are such files, they will be replaced, which will lead to a container startup or workload creation failure.
      NOTICE:

      If a volume is mounted to a high-risk directory, use an account with minimum permissions to start the container, or high-risk files on the host may be damaged.

      Subpath

      Enter the subpath of the storage volume and mount a path in the storage volume to the container. In this way, different folders of the same storage volume can be used in a single pod. data, for example, indicates that data in the mount path of the container is stored in the data directory of the storage volume. If this parameter is left blank, the root path is used by default.

      Permission

      • Read-only: You can only read the data in the mounted volume.
      • Read-write: You can modify the volume mounted to the path. Newly written data will not be migrated if the container is migrated, which may cause data loss.
    3. Configure other parameters and click Create Workload.

      After the workload is created, the data in the container mount directory will be persistently stored. Verify the storage by referring to Verifying Data Persistence.

  1. Use kubectl to connect to the cluster.
  2. Use StorageClass to dynamically create a PVC and PV.

    1. Create the pvc-evs-auto.yaml file.
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: pvc-evs-auto
        namespace: default
        annotations:
            everest.io/disk-volume-type: SAS    # EVS disk type
          everest.io/enterprise-project-id: <your_project_id>  # (Optional) Enterprise project ID. If an enterprise project is specified, use the same enterprise project when creating a PVC. Otherwise, the PVC cannot be bound to a PV.
      
          everest.io/disk-volume-tags: '{"key1":"value1","key2":"value2"}' # (Optional) Custom resource tags
      
          everest.io/disk-iops: '3000'      # (Optional) IOPS of only a GPSSD2 EVS disk
          everest.io/disk-throughput: '125' # (Optional) Throughput of only a GPSSD2 EVS disk
      
          everest.io/csi.volume-name-prefix: test  # (Optional) Storage volume name prefix of the automatically created underlying storage
      
        labels:
          failure-domain.beta.kubernetes.io/region: <your_region>   # Replace the region with the one where the cluster is located.
          failure-domain.beta.kubernetes.io/zone: <your_zone>       # Replace the AZ with the one where the EVS disk is located.
      spec:
        accessModes:
        - ReadWriteOnce               # The value must be ReadWriteOnce for EVS disks.
        resources:
          requests:
            storage: 10Gi             # EVS disk capacity, in GiB. The value ranges from 1 to 32768.
        storageClassName: csi-disk    # The StorageClass of the EVS disk
      Table 2 Key parameters

      Parameter

      Mandatory

      Description

      failure-domain.beta.kubernetes.io/region

      Yes

      Region of the cluster.

      For example, cn-east-3. For details, see Regions and Endpoints.

      failure-domain.beta.kubernetes.io/zone

      Yes

      AZ of the EVS disk.

      You can obtain all supported AZs by querying the AZ list.

      everest.io/disk-volume-type

      Yes

      EVS disk type. All letters are in uppercase. EVS disk types vary depending on regions. Obtain the available EVS types on the console.
      • SAS: high I/O
      • SSD: ultra-high I/O
      • GPSSD: general-purpose SSD
      • ESSD: extreme SSD
      • GPSSD2: general-purpose SSD v2. You need to specify the everest.io/disk-iops and everest.io/disk-throughput annotations.

      everest.io/disk-iops

      No

      Preconfigured IOPS, which is supported only by general-purpose SSD v2 EVS disks.
      • The IOPS of general-purpose SSD v2 EVS disks ranges from 3000 to 128000, and the maximum value is 500 times of the capacity (GiB).

        If the IOPS of general-purpose SSD v2 disks is greater than 3000, extra IOPS will be billed. For details, see Price Calculator.

      everest.io/disk-throughput

      No

      Preconfigured throughput, which is supported only by general-purpose SSD v2 EVS disks.

      The value ranges from 125 MiB/s to 1,000 MiB/s. The maximum value is a quarter of IOPS.

      If the throughput is greater than 125 MiB/s, extra throughput will be billed. For details, see Price Calculator.

      everest.io/enterprise-project-id

      No

      Enterprise project ID of the EVS disk. This parameter is optional. If an enterprise project is specified, use the same enterprise project when creating a PVC, or the PVC cannot be bound to a PV.

      To obtain an enterprise project ID, log in to the EPS console, click the name of the target enterprise project, and copy the enterprise project ID.

      everest.io/disk-volume-tags

      No

      You can add resource tags to classify resources. This field is optional.

      You can create predefined tags on the TMS console. The predefined tags are available to all resources that support tags. You can use predefined tags to improve the tag creation and resource migration efficiency. For details, see Creating Predefined Tags.

      CCE automatically creates system tags CCE-Cluster-ID={Cluster ID}, CCE-Cluster-Name={Cluster name}, and CCE-Namespace={Namespace name}. These tags cannot be modified.

      everest.io/csi.volume-name-prefix

      No

      This parameter is optional. It specifies the name of the underlying storage that is automatically created. The actual underlying storage name is in the format of "PV name prefix + PVC UID". If this parameter is left blank, the default prefix pvc will be used.

      Enter 1 to 26 characters that cannot start or end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

      For example, if the storage volume name prefix is set to test, the actual underlying storage name is test-{UID}.

      storage

      Yes

      Requested PVC capacity, in Gi. The value ranges from 1 to 32768.

      storageClassName

      Yes

      The StorageClass for EVS volumes is csi-disk.

    2. Run the following command to create a PVC:
      kubectl apply -f pvc-evs-auto.yaml

  3. Create a workload.

    1. Create a file named web-evs-auto.yaml. In this example, the EVS volume is mounted to the /data path.
      apiVersion: apps/v1
      kind: StatefulSet
      metadata:
        name: web-evs-auto
        namespace: default
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: web-evs-auto
        serviceName: web-evs-auto   # Headless Service name
        template:
          metadata:
            labels:
              app: web-evs-auto
          spec:
            containers:
            - name: container-1
              image: nginx:latest
              volumeMounts:
              - name: pvc-disk    # Volume name, which must be the same as the volume name in the volumes field.
                mountPath: /data  #Location where the storage volume is mounted.
            imagePullSecrets:
              - name: default-secret
            volumes:
              - name: pvc-disk    # Custom volume name
                persistentVolumeClaim:
                  claimName: pvc-evs-auto    # Name of the created PVC.
      ---
      apiVersion: v1
      kind: Service
      metadata:
        name: web-evs-auto   # Headless Service name
        namespace: default
        labels:
          app: web-evs-auto
      spec:
        selector:
          app: web-evs-auto
        clusterIP: None
        ports:
          - name: web-evs-auto
            targetPort: 80
            nodePort: 0
            port: 80
            protocol: TCP
        type: ClusterIP
    2. Run the following command to create a workload that the EVS volume is mounted to:
      kubectl apply -f web-evs-auto.yaml

      After the workload is created, the data in the container mount directory will be persistently stored. Verify the storage by referring to Verifying Data Persistence.

Verifying Data Persistence

  1. View the deployed application and files stored in the EVS volume.

    1. Run the following command to view the pod:
      kubectl get pod | grep web-evs-auto
      Expected output:
      web-evs-auto-0                  1/1     Running   0               38s
    2. Run the following command to verify that the EVS volume has been mounted to the /data path:
      kubectl exec web-evs-auto-0 -- df | grep data

      Expected output:

      /dev/sdc              10255636     36888  10202364   0% /data
    3. Run the following command to view the created file in the /data path:
      kubectl exec web-evs-auto-0 -- ls /data

      Expected output:

      lost+found

  2. Run the following command to create a file named static in the /data path:

    kubectl exec web-evs-auto-0 --  touch /data/static

  3. Run the following command to view the created file in the /data path:

    kubectl exec web-evs-auto-0 -- ls /data

    Expected output:

    lost+found
    static

  4. Run the following command to delete the pod named web-evs-auto-0:

    kubectl delete pod web-evs-auto-0

    Expected output:

    pod "web-evs-auto-0" deleted

  5. The StatefulSet controller automatically creates a replica with the same name as the pod. Run the following command to check whether the file in the /data path has been modified:

    kubectl exec web-evs-auto-0 -- ls /data

    Expected output:

    lost+found
    static

    The static file is retained, indicating that the data can be stored persistently.

Related Operations

You can also perform the operations described in Table 3.
Table 3 Related operations

Operation

Description

Procedure

Expanding the capacity of an EVS volume

Quickly expand the capacity of a mounted EVS volume on the CCE console.

  1. In the navigation pane on the left, choose Storage. Then click the PVCs tab. Locate the target PVC and click More > Scale-out in the Operation column.
  2. Enter the capacity to be added and click OK.

Viewing events

You can view event names, event types, number of occurrences, Kubernetes events, first occurrence time, and last occurrence time of the PVC or PV.

  1. In the navigation pane on the left, choose Storage. Then click the PVCs or PVs tab.
  2. Locate the target PVC or PV, click View Events in the Operation column to view events generated within one hour (events are retained for one hour).

Viewing a YAML file

You can view, copy, and download the YAML files of a PVC or PV.

  1. In the navigation pane on the left, choose Storage. Then click the PVCs or PVs tab.
  2. Locate the target PVC or PV, click View YAML in the Operation column to view or download the YAML.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback