k8s Pv is not created

8/4/2021

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?

-- JJD
amazon-web-services
kubernetes
kubernetes-pvc
persistent-volumes

1 Answer

8/4/2021

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
Source: StackOverflow