I'm trying to create a test pod which has a persistent volume.
This is my pod.yaml and pvc.yaml on an an EKS cluster.
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-pvc namespace: my-ns spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: gp2 apiVersion: v1 kind: Pod metadata: name: test-pod namespace: my-ns spec: containers: - name: test-container image: busybox command: ["sleep", "3600"] volumeMounts: - mountPath: /mnt/data name: my-pvc-volume volumes: - name: my-pvc-volume persistentVolumeClaim: claimName: my-pvc
If I describe the PVC, it shows as follows:
Warning ProvisioningFailed 4m58s (x5 over 14m) ebs.csi.aws.com_ebs-csi-controller-dd646df8-7ddpr_aca98eff-9b9a-4bce-8049-b34905dffc7e failed to provision volume with StorageClass "gp2": rpc error: code = Internal desc = Could not create volume "pvc-1bed8d46-f728-4b15-b7e │ f-9a5425c0814d": could not create volume in EC2: operation error EC2: CreateVolume, get identity: get credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded
Normal ExternalProvisioning 71s (x99 over 25m) persistentvolume-controller Waiting for a volume to be created either by the external provisioner 'ebs.csi.aws.com' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
The logs of EBS-CSI pod in kube-system shows the error: "failed to refresh cached credentials, no EC2 IMDS role found"
E1005 20:52:29.823331 1 driver.go:108] "GRPC error" err="rpc error: code = Internal desc = Could not create volume "pvc-1bed8d46-f728-4b15-b7ef-9a5425c0814d": could not create volume in EC2: operation error EC2: CreateVolume, get identity: get credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, canceled, context deadline exceeded"