Skip to content
Browse files

Add documentations for volume resizing

  • Loading branch information...
leakingtapan committed Jun 29, 2019
1 parent f23d7d7 commit c8d83131619a11ec6539aa197c0821e2461e2390
Showing with 81 additions and 0 deletions.
  1. +2 −0 docs/
  2. +43 −0 examples/kubernetes/resizing/
  3. +36 −0 examples/kubernetes/resizing/spec/example.yaml
@@ -66,6 +66,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll
* **Block Volume** - consumes the EBS volume as a raw block device for latency sensitive application eg. MySql
* **Volume Snapshot** - creating volume snapshots and restore volume from snapshot.
* **NVMe** - consume NVMe EBS volume from EC2 [Nitro instance](
* **Volume Resizing** - expand the volume size.

## Prerequisites
* If you are managing EBS volumes using static provisioning, get yourself familiar with [EBS volume](
@@ -107,6 +108,7 @@ Make sure you follow the [Prerequisites]( before the exa
* [Block Volume](../examples/kubernetes/block-volume)
* [Volume Snapshot](../examples/kubernetes/snapshot)
* [Configure StorageClass](../examples/kubernetes/storageclass)
* [Volume Resizing](../examples/kubernetes/resizing)

## Migrating from in-tree EBS plugin
Starting from Kubernetes 1.14, CSI migration is supported as alpha feature. If you have persistence volumes that are created with in-tree `` plugin, you could migrate to use EBS CSI driver. To turn on the migration, set `CSIMigration` and `CSIMigrationAWS` feature gates to `true` for `kube-controller-manager` and `kubelet`.
@@ -0,0 +1,43 @@
## Volume Resizing
This example shows how to resize EBS persistence volume using volume resizing features.

1. CSI volume resizing is still alpha as of Kubernetes 1.15
2. EBS has a limit of one volume modification every 6 hours. Refer to [EBS documentation]( for more details.

## Usage
1. Add `allowVolumeExpansion: true` in the StorageClass spec in [example manifest](./specs/example.yaml) to enable volume expansion. You can only expand a PVC if its storage class’s allowVolumeExpansion field is set to true

2. Deploy the example:
kubectl apply -f specs/

3. Verify the volume is created and Pod is running:
kubectl get pv
kubectl get po app

4. Expand the volume size by increasing the capacity in PVC's ``:
kubectl edit pvc ebs-claim
Save the result at the end of the edit.

5. Verify that both the persistence volume and persistence volume claim are resized:
kubectl get pv
kubectl get pvc
You should see that both should have the new value relfected in the capacity fields.

6. Verify that the application is continuously running without any interruption:
kubectl exec -it app cat /data/out.txt

7. Cleanup resources:
kubectl delete -f specs/
@@ -0,0 +1,36 @@
kind: StorageClass
name: resize-sc
allowVolumeExpansion: true
apiVersion: v1
kind: PersistentVolumeClaim
name: ebs-claim
- ReadWriteOnce
storageClassName: resize-sc
storage: 4Gi
apiVersion: v1
kind: Pod
name: app
- name: app
image: centos
command: ["/bin/sh"]
args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"]
- name: persistent-storage
mountPath: /data
- name: persistent-storage
claimName: ebs-claim

0 comments on commit c8d8313

Please sign in to comment.
You can’t perform that action at this time.