title: NFS Persistant Volume monitoring in prometheus
body: <p>I have a Persistent Volume of type NFS with a source server running locally. This NFS server is using a Persistent Volume Claim that lives on GCP. Everything is running fine, however, I cannot monitor the PVC on Prometheus for some reason.  It's just not showing up.</p>
  <p><strong>Question:</strong>  How can I monitor the usage of such disks? Do I need to install some drivers or configure custom scraping?</p>
  <p><strong>Here are the PromQL queries I tried:</strong></p>
  <pre><code>kubelet_volume_stats_capacity_bytes
  kubelet_volume_stats_available_bytes
  node_filesystem_size_bytes
  </code></pre>
  <p>Note:  I'm able to see the volume here, but I can only see it's capacity, not the usage.</p>
  <pre><code>kube_persistentvolume_capacity_bytes
  </code></pre>
  <p><strong>Here's the config file for the NFS server:</strong></p>
  <pre><code>apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: nfs-server
  spec:
    replicas: 1
    selector:
      matchLabels:
        role: nfs-server
    template:
      metadata:
        labels:
          role: nfs-server
      spec:
        containers:
        - name: nfs-server
          image: gcr.io/google_containers/volume-nfs:0.8
          ports:
            - name: nfs
              containerPort: 2049
            - name: mountd
              containerPort: 20048
            - name: rpcbind
              containerPort: 111
          securityContext:
            privileged: true
          volumeMounts:
            - mountPath: /exports
              name: nfs-pvc
        volumes:
          - name: nfs-pvc
            gcePersistentDisk:
              pdName: nfs-disk
              fsType: ext4
  </code></pre>
  <p><strong>Here's the PV config:</strong></p>
  <pre><code>Status:          Bound
  Claim:           default/nfs-pvc
  Reclaim Policy:  Retain
  Access Modes:    RWX
  VolumeMode:      Filesystem
  Capacity:        1000Gi
  Node Affinity:   &lt;none&gt;
  Message:
  Source:
      Type:      NFS (an NFS mount that lasts the lifetime of a pod)
      Server:    nfs-server.default.svc.cluster.local
      Path:      /
      ReadOnly:  false
  </code></pre>
  <p><strong>Here's the PVC config:</strong></p>
  <pre><code>Name:          nfs-pvc
  Namespace:     default
  StorageClass:
  Status:        Bound
  Volume:        nfs-pv
  Finalizers:    [kubernetes.io/pvc-protection]
  Capacity:      1000Gi
  Access Modes:  RWX
  VolumeMode:    Filesystem
  Mounted By:    ...
  </code></pre>
  <ul>
  <li><strong>Kubernetes Version:</strong> 1.16.15-gke.500</li>
  <li><strong>Prometheus Version</strong>: 2.21.0</li>
  <li><strong>Prometheus Helm Chart:</strong> <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus</a></li>
  </ul>