Mounting an Ephemeral Volume
In CCI 2.0, you can mount an emptyDir volume for ephemeral storage.
Constraints
- Subpaths are not supported.
- The sizeLimit parameter of emptyDir is only valid when emptyDir.medium is set to Memory.
- Log in to the CCI 2.0 console.
- In the navigation pane, choose Workloads. Then click Create Workload.
- In the Data Storage area, click Add Volume. Then set Storage Type to emptyDir volume and enter a volume name.
There are three options for data storage: emptyDir volume, ConfigMap, and secret. Here, set Storage Type to emptyDir volume.

- Add a container: Configure basic information for the container and click Next.
- Configure advanced settings for the container: Mount the emptyDir volume added in 3 to the container.

- Select the image repository access credential, configure the upgrade policy, and complete the workload creation.

- Click the workload name to view the pod.

- Log in to the CCI 2.0 console.
- In the navigation pane, choose Workloads. Then, click Create from YAML and replace the YAML content to create the workload.

The following shows an example YAML for creating a workload:
kind: Deployment apiVersion: cci/v2 metadata: name: demoapp # Workload name namespace: test # Namespace where the workload is located spec: replicas: 1 selector: matchLabels: app: demoapp template: metadata: creationTimestamp: null labels: app: demoapp annotations: resource.cci.io/instance-type: general-computing # Pod type: general-computing pods resource.cci.io/pod-size-specs: 1.00_2.0 spec: volumes: # An ephemeral volume is used. - name: app-log emptyDir: {} containers: - name: demoapp image: nginx:stable-alpine-perl # Image path. Replace it with your own image path. resources: limits: cpu: '1' memory: 2G requests: cpu: '1' memory: 2G volumeMounts: # Mount an ephemeral volume to the container. - name: app-log readOnly: true mountPath: /usr/local/logs terminationMessagePath: /dev/termination-log terminationMessagePolicy: File restartPolicy: Always terminationGracePeriodSeconds: 30 dnsPolicy: Default securityContext: {} imagePullSecrets: - name: imagepull-secret schedulerName: default-scheduler strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 25% maxSurge: 100% progressDeadlineSeconds: 600
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot