<p>I would like to understand the difference between PVC capacity I assigned (5G) and the container available capacity reported against the mounted volume inside the container.</p>
<ol>
<li>Have a GCE PD with 10G capacity</li>
<li>Have a PVC with 5G capacity against the same GCE PD.</li>
<li>However, when I run df -h inside the PVC volume mount inside a container:
It shows available capacity against the volume as 9.5G.</li>
</ol>
<blockquote>
<pre><code>sh-4.4$ kubectl get pvc,pv -o wide
NAME                              STATUS   VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE   VOLUMEMODE
persistentvolumeclaim/nfs-claim   Bound    nfs-pv   5Gi        RWX                           17d   Filesystem

NAME                      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM               STORAGECLASS   REASON   AGE   VOLUMEMODE
persistentvolume/nfs-pv   5Gi        RWX            Retain           Bound    default/nfs-claim                           17d   Filesystem
sh-4.4$ kubectl get pvc,pv -o wide
NAME                              STATUS   VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE   VOLUMEMODE
persistentvolumeclaim/nfs-claim   Bound    nfs-pv   5Gi        RWX                           17d   Filesystem

NAME                      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM               STORAGECLASS   REASON   AGE   VOLUMEMODE
persistentvolume/nfs-pv   5Gi        RWX            Retain           Bound    default/nfs-claim                           17d   Filesystem
</code></pre>
</blockquote>
<p>Deployment PVC:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-claim
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: &quot;&quot;
  resources:
    requests:
      storage: 5Gi
</code></pre>
<p>Deployment:</p>
<pre><code>...
volumes:
     - name: molecule-storage
          persistentVolumeClaim:
            claimName: nfs-claim
volumeMounts:
          - name: molecule-storage
            mountPath: &quot;/mnt/boomi&quot;
</code></pre>
<p>I would expect this to be 5G as per PVC capacity instead.
Any ideas?</p>

Rubans
<p>Persistent volumes can be attached to pods in a variety of ways. When you set the storage requests for dynamic provisioning to 30 Gi, GCE PD will be automatically provisioned for you with 30 Gi. However, the storage size will equal the size of the GCE PD if you opt to use the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/preexisting-pd" rel="nofollow noreferrer">preexisting PD</a> or static provisioning.</p>
<p>The <a href="https://github.com/kubernetes/kubernetes/issues/48701" rel="nofollow noreferrer">PV storage capacity</a> field is merely a label; K8s won't enforce the storage capacity. It is the implementer's responsibility to make sure that storage size and <a href="https://github.com/kubernetes/kubernetes/issues/68736" rel="nofollow noreferrer">capacity</a> are compatible.</p>
