Persistent volume: When we create Persistent volume claim why dont we mention w . . .

Mirage:
Persistent volume: When we create Persistent volume claim why dont we mention which persistent volume we want to use?

Uğurcan Çaykara:
actually you do,

Uğurcan Çaykara:
but you should also create a storage class to claim volume

Uğurcan Çaykara:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-pvc-mssql
namespace: test
spec:
storageClassName: nfs-storageclass
accessModes:

  • ReadWriteMany PersistentVolume
    resources:
    requests:
    storage: 20Gi

Uğurcan Çaykara:
you can try it specify under spec: storageClassName that is the persistent volume you created

Mirage:
in the mock test when pv is already created then i created claim without mentioning any storage class and it worked

Uğurcan Çaykara:
Yep

Uğurcan Çaykara:
That works fine too