<p>I am trying to use Persistent Volumes in AWS EKS.</p>
<p>I followed all the steps mentioned from the below link</p>
<p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-persistent-storage/" rel="noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/eks-persistent-storage/</a></p>
<p>When I deployed sample pods to check PVCs are created fine, I am getting below error.</p>
<pre><code>Warning  FailedScheduling  2m6s (x265 over 44h)  default-scheduler  error while running &quot;VolumeBinding&quot; prebind plugin for pod &quot;app&quot;: Failed to bind volumes: timed out waiting for the condition
</code></pre>
<p>Checked further persistent volume claims</p>
<pre><code>kubectl describe pvc
  Warning  ProvisioningFailed    62s (x7 over 3m5s)    ebs.csi.aws.com_ebs-csi-controller-7cb88dcffc-vkvdk_2ae45c3c-b4f2-4200-a5d4-cfdb35a5f0db  failed to provision volume with StorageClass &quot;ebs-sc&quot;: rpc error: code = DeadlineExceeded desc = context deadline exceeded
</code></pre>
<p>From looking at the logs of ebs csi controller</p>
<pre><code>I0721 10:44:10.049138       1 event.go:282] Event(v1.ObjectReference{Kind:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;avengers&quot;, Name:&quot;ebs-claim&quot;, UID:&quot;88a9684c-1be7-412f-8616-b662eff692df&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;19320908&quot;, FieldPath:&quot;&quot;}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass &quot;ebs-sc&quot;: rpc error: code = Internal desc = WebIdentityErr: failed to retrieve credentials
caused by: InvalidIdentityToken: No OpenIDConnect provider found in your account for https://oidc.eks.us-east-2.amazonaws.com/id/XXXXXXXXXXXX34FDCBXXXXX
        status code: 400, request id: 90b430ba-6999-41d8-ac15-13f5ec73def2
I0721 10:44:45.207103       1 controller.go:1332] provision &quot;default/ebs-claim&quot; class &quot;ebs-sc&quot;: started
I0721 10:44:45.207406       1 event.go:282] Event(v1.ObjectReference{Kind:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;default&quot;, Name:&quot;ebs-claim&quot;, UID:&quot;3922ab97-483a-486a-bbbd-57875e506021&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;19875393&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim &quot;default/ebs-claim&quot;
I0721 10:44:55.207594       1 controller.go:1106] Temporary error received, adding PVC 3922ab97-483a-486a-bbbd-57875e51 to claims in progress
W0721 10:44:55.207639       1 controller.go:958] Retrying syncing claim &quot;3922ab97-483a-486a-bbbd-57875e506021&quot;, failure 9
E0721 10:44:55.207664       1 controller.go:981] error syncing claim &quot;3922ab97-483a-486a-bbbd-57875e506021&quot;: failed to provision volume with StorageClass &quot;ebs-sc&quot;: rpc error: code = DeadlineExceeded desc = context deadline exceeded
I0721 10:44:55.207859       1 event.go:282] Event(v1.ObjectReference{Kind:&quot;PersistentVolumeClaim&quot;, Namespace:&quot;default&quot;, Name:&quot;ebs-claim&quot;, UID:&quot;3922ab97-483a-486a-bbbd-57875e506021&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;19875393&quot;, FieldPath:&quot;&quot;}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass &quot;ebs-sc&quot;: rpc error: code = DeadlineExceeded desc = context
</code></pre>
<p>What did I miss here ?</p>
<p>Any help will be appreciated.</p>

<p>From the error log, pick the id for search and i.e. <code>XXXXXXXXXXXX34FDCBXXXXX</code></p>
<pre><code>caused by: InvalidIdentityToken: No OpenIDConnect provider 
found in your account for 
https://oidc.eks.us-east-2.amazonaws.com/id
/XXXXXXXXXXXX34FDCBXXXXX
status code: 400, request id: 90b430ba-6999-41d8-ac15-13f5ec73def2

</code></pre>
<h2>Search in OpenID connect providers list</h2>
<p>IAM OIDC (OpenID Connect) Identity provider didn’t exist for current EKS Cluster.</p>
<pre><code>aws iam list-open-id-connect-providers | grep XXXXXXXXXXXX34FDCBXXXXX
</code></pre>
<p>returned nothing.</p>
<h2>Enable OIDC IAM</h2>
<p>Enabled OIDC IAM in existing EKS Cluster:</p>
<pre><code>$ eksctl utils associate-iam-oidc-provider --cluster=eks-lab --region us-east-2 --approve
</code></pre>
<p>Deleted everything and deployed again and now it works fine.</p>
<p><a href="https://eksctl.io/usage/iamserviceaccounts/" rel="nofollow noreferrer">References</a>.</p>
