Syed Iftekharuddin
Syed Iftekharuddin

Reputation: 146

Storage Capacity for PersistenceVolumeClaim for volumes of type NFS on Openshift

I have a project on openshift, I am using volume of the type NFS to store some files from the application to the NFS share point. While creating PVC I mentioned capacity as PV:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: classic-nfs
  mountOptions:
    - hard
    - nfsvers=3
  nfs:
    path: /somePath
    server: someDNSname
    readOnly: false

PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: classic-nfs
  volumeName: pv

Now, I see that the store keeps on decreasing if I see the PersistenceVolumeClaim on openshift as shown in the below pic. enter image description here

My question is , since we are using NFS type volume, does mentioning storage capacity (ex: 10GB) really matters here?

Upvotes: 2

Views: 1060

Answers (1)

David Ogren
David Ogren

Reputation: 4800

I really might be missing something because I don't understand why you think the request size wouldn't matter for NFS? (More on this latter)

Here are the docs for NFS persistent storage.

I think the key bits from the docs are:

  • Storage must exist in the underlying infrastructure before it can be mounted as a volume in OpenShift Container Platform. To provision NFS volumes, a list of NFS servers and export paths are all that is required.
  • [the amount specified in capacity.storage] The amount of storage allocated to this volume.
  • You can use disk partitions to enforce disk quotas and size constraints. Each partition can be its own export. Each export is one PV.
  • The bit where it talks about how PVCs match to PVs that have appropriate capacity.

I feel like I'm missing something about your question. Because, of course, from an OpenShift perspective it matters how much space is in the volume. If your question is whether it really matters because you are doing some overallocation on the backend of your storage provider, I guess that depends on your backend.

Upvotes: 1

Related Questions