<p>I'm converting volume gp2 to volume gp3 for EKS but getting this error.<br />
<em><strong>Failed to provision volume with StorageClass &quot;gp3&quot;: invalid AWS VolumeType &quot;gp3&quot;</strong></em><br />
This is my config.</p>
<p>StorageClass</p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: &quot;true&quot;
  name: gp3
parameters:
  fsType: ext4
  type: gp3
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer   
</code></pre>
<p>PVC</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    app: test-pvc
  name: test-pvc
  namespace: default
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: gp3   
</code></pre>
<p>When I type <code>kubectl describe pvc/test</code>. This is response:</p>
<pre><code>Name:          test-pvc
Namespace:     default
StorageClass:  gp3
Status:        Pending
Volume:        
Labels:        app=test-pvc
Annotations:   volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/aws-ebs
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       &lt;none&gt;
Events:
  Type     Reason              Age                  From                         Message
  ----     ------              ----                 ----                         -------
  Warning  ProvisioningFailed  58s (x9 over 4m35s)  persistentvolume-controller  Failed to provision volume with StorageClass &quot;gp3&quot;: invalid AWS VolumeType &quot;gp3&quot;   
</code></pre>
<p>I'm using Kubernetes version 1.18.<br />
Can someone help me. Thanks!</p>

<p>I found the solution to use volume <code>gp3</code> in storage class on EKS.</p>
<ol>
<li>First, you need to install <code>Amazon EBS CSI driver</code> with offical instruction <a href="https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html" rel="nofollow noreferrer">here</a>.</li>
<li>The next, you need to create the storage class <code>ebs-sc</code> after <code>Amazon EBS CSI driver</code> is installed, example:</li>
</ol>
<hr />
<pre><code>cat &lt;&lt; EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
parameters:
  type: gp3
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
EOF
</code></pre>
<p>So, you can use volume <code>gp3</code> in storage class on EKS.<br />
You can check by deploying resources:</p>
<pre><code>cat &lt;&lt; EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-gp3-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: ebs-sc
---
apiVersion: v1
kind: Pod
metadata:
  name: app-gp3-in-tree
spec:
  containers:
  - name: app
    image: nginx
    volumeMounts:
    - name: persistent-storage
      mountPath: /usr/share/nginx/html
  volumes:
  - name: persistent-storage
    persistentVolumeClaim:
      claimName: ebs-gp3-claim
EOF
</code></pre>
<p>Detailed documentation on Migrating Amazon EKS clusters from gp2 to gp3 EBS volumes: <a href="https://aws.amazon.com/vi/blogs/containers/migrating-amazon-eks-clusters-from-gp2-to-gp3-ebs-volumes/" rel="nofollow noreferrer">https://aws.amazon.com/vi/blogs/containers/migrating-amazon-eks-clusters-from-gp2-to-gp3-ebs-volumes/</a></p>
<p>References: <a href="https://stackoverflow.com/questions/69290796/persistent-storage-in-eks-failing-to-provision-volume">Persistent Storage in EKS failing to provision volume</a></p>
