0

I want to create PV&PVC and the PV is not created , can you please advice what am I doing wrong?

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: my-sc
provisioner: kubernetes.io/aws-ebs
parameters:
  type: io1
  iopsPerGB: "100"
  fsType: ext4
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
  namespace: myns
spec:
  storageClassName: io1
  volumeName: my-sc
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 100Gi

The issue is that the PV is not created...what am I doing wrong?

PJEM
  • 557
  • 7
  • 33
  • You will need to provide the `kubectl events` output, and probably logs from the cluster. But it's probably IAM. – mcfinnigan Aug 04 '21 at 13:11

1 Answers1

1

Your StorageClass is named my-sc

Your PersistentVolumeClaim has its spec.storageClassName set to io1.

It should match an existing StorageClass name (my-sc).

You should delete your PVC, and re-create it with the proper storageClassName.

SYN
  • 4,476
  • 1
  • 20
  • 22