• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide
  4. FAQs
  5. What Is a Volume?

What Is a Volume?

A volume is a specially-designated directory within one or more containers that bypasses the Union File System. Using a volume means mounting an absolute path on a host (also called a node) to a path on a container, thereby achieving sharing between hosts and containers.

The current CCE version supports only EVS plug-ins.

There are two ways to define a volume:

  • Specify the Volumes parameter on either the Create Component Template page or the Create App Design page of the CCE console
  • Run the docker run command with the -v option

    For example, to mount the /src/webapp directory on a host to the /opt/webapp directory on the frontend container, run the following command:

    docker run -d -P --name frontend -v /src/webapp:/opt/webapp frontend

To add storage for an application, specify the Volumes parameter on the Create Component Template page or on the App Designer page. The application's storage space is the host path on the node where the application is deployed

Another way to add storage for the application is to use APIs to create the application and then add storage.

PersistentVolume is a storage resource. CCE supports three PersistentVolume types: hostpath, nfs, and hwsElasticVolumeService. The PersistentVolumes of hostpath type deliver the same functions as the Volumes configured on the CCE console. For details about PersistentVolumes of nfs and hwsElasticVolumeService types and related APIs, see Cloud Container Engine API Reference.