• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Container Orchestration
  5. Using an EVS Disk

Using an EVS Disk

The CCE uses plug-ins to connect to EVS disks to support persistent storage.

The following example shows how to define an EVS disk in a chart. When creating the chart application, the container dynamically creates a 10 Gi EVS disk and attaches it to the container.

Currently, the CCE supports only creating EVS disks in a dynamic way.

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: {{ .Release.Name }}-slave
spec:
  updateStrategy: 
    type: "RollingUpdate"
  serviceName: {{ .Release.Name }}-slave-headless
  replicas: 1
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}-slave
        type: slave
        release: "{{ .Release.Name }}"
    spec:
      containers:
        - name: {{ .Release.Name }}-slave
          image: {{ .Values.chartimage.app_image }}
          volumeMounts:
          - mountPath: /redis-data
            name: {{ .Release.Name }}-slave
          - mountPath: /opt/rancher/
            name: utility
          - mountPath: /etc/redis/
            name: redis-conf
          ports:
            - containerPort: 6379
  volumeClaimTemplates:
  - metadata:
      labels:
        app: {{ .Release.Name }}-slave
        type: slave
        release: "{{ .Release.Name }}"
      name: {{ .Release.Name }}-slave
      annotations:
        "volume.beta.kubernetes.io/storage-class": sas
        "volume.beta.kubernetes.io/storage-provisioner": flexvolume-huawei.com/fuxivol
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Gi
Table 1 Key parameters

Parameter

Description

*annotations

Used for console display. volume.beta.kubernetes.io/storage-class indicates the EVS disk type (SAS, SATA, or SSD). For details, see the definition of the EVS service. The value of volume.beta.kubernetes.io/storage-provisioner is fixed at flexvolume-huawei.com/fuxivol.

*accessModes

EVS access mode. Three options are available:

  • ReadWriteOnce
  • ReadOnlyMany
  • ReadWriteMany

*resource.request.storage

Size of the EVS disk, in Gi. The minimum value is 10.