# 扩容临时存储空间
#### 使用场景
CCI默认为pod分配30GiB的临时存储空间，该存储空间与pod的生命周期保持一致，默认分配的30GiB存储空间免费。当pod需要写入大量数据至rootfs或emptyDir以及镜像大于30GiB，在CCE突发弹性引擎（对接 CCI）场景下，您可以参考本章节扩容临时存储空间。需要注意超过30 GiB的额外扩容空间将按需收取费用，详细计费规则请参见[计费说明](https://support.huaweicloud.com/price-cci2/cci_06_1006.html)。
#### 使用须知
- 临时存储空间扩容大小限制为\[0,994\]。
- 扩展临时存储空间时，由于扩容需要时间，负载创建会慢于常规负载。
- 在CCE突发弹性引擎（对接 CCI）场景下，必须通过在Pod的Annotation中添加**resource.cce.io/extra-ephemeral-storage-in-GiB**来实现扩容。
 
#### 使用YAML扩展临时存储空间
- 创建无状态负载时，扩容10GiB临时存储空间YAML定义如下：
  ```
  apiVersion: apps/v1      
  kind: Deployment        
  metadata:
    name: nginx      
    namespace: ns
    labels:
      bursting.cci.io/burst-to-cci: enforce # 将pod强制调度到 CCI 2.0
  spec:
    replicas: 1                     
    selector:              
      matchLabels:
        app: nginx
    template:              
      metadata:
        labels:
          app: nginx
        annotations:                  
          resource.cce.io/extra-ephemeral-storage-in-GiB: "10" # 临时存储空间扩容大小，单位为GiB
      spec:
        containers:
        - image: nginx:alpine
          name: container-0
          resources:
            limits:
              cpu: 250m
              memory: 512Mi
            requests:
              cpu: 250m
              memory: 512Mi
        imagePullSecrets:
        - name: default-secret
  ```
  
- 创建容器组时，扩容10GiB临时存储空间YAML定义如下：
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: nginx
    namespace: ns
    labels:                                               
      bursting.cci.io/burst-to-cci: enforce
    annotations:                                           
      resource.cce.io/extra-ephemeral-storage-in-GiB: "10"        # 临时存储空间扩容大小，单位为GiB
  spec:
    containers:
    - image: nginx:alpine
      name: container-0
      resources:                 
        limits:
          cpu: 250m
          memory: 512Mi
        requests:
          cpu: 250m
          memory: 512Mi
    imagePullSecrets:
     - name: default-secret
  ```
  
 
#### 查看是否扩容成功
1. 登录[CCE控制台](https://console.huaweicloud.com/cce2.0/?#/cce/cluster/list)。
2. 选择CCE集群，单击进入CCE集群总览页面。
3. 在左侧导航树选择"工作负载"，选择"容器组"页签。
4. 单击Pod所在行的"更多 \> 远程登录"。
5. 输入lsblk并回车，查看扩容后的系统盘大小为40GiB（默认为30GiB）。 
   ![](https://support.huaweicloud.com/usermanual-cci2/zh-cn_image_0000002554742317.png)
   
   
 
