# NFS Persistent Volume Claim

**URL:** <https://forums.suse.com/t/nfs-persistent-volume-claim/16398>\
**Category:** SUSE Rancher Prime\
**Created:** [January 22, 2020, 9:41pm UTC](https://forums.suse.com/t/nfs-persistent-volume-claim/16398 "2020-01-22T21:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_De\_Matos](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/carlos_de_matos/32/2474_2.png) [@Carlos\_De\_Matos](https://forums.suse.com/u/Carlos_De_Matos)\
**Post date:** [January 22, 2020, 9:41pm UTC](https://forums.suse.com/t/nfs-persistent-volume-claim/16398/1 "2020-01-22T21:41:19Z")

</div>

This is a Kubernettes question, I have an RKE cluster and created on my rancher instance. I am trying to create some PVCs which will be NFS served from my FreeNAS server, and I am struggling to get this work, or event to find an example of it.

Can NFS only be defined as a volume directly in a POD?

What am I missing?

---

<div class="post-metadata">

**Author:** ![seimic](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/seimic/32/6370_2.png) [@seimic](https://forums.suse.com/u/seimic)\
**Post date:** [January 23, 2020, 8:08am UTC](https://forums.suse.com/t/nfs-persistent-volume-claim/16398/2 "2020-01-23T08:08:05Z")

</div>

Hi,

you need to install the “Nfs-Client-Provisioner” in your cluster.  
This creates a storage class “nfs-client” which you can use like  
any other storage provider (except few NFS limits like storage size etc.).

At least the following answers have to be provided to access your server.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/7/71c8aa9fc02dedd66ead90b53f253bc943927585.png)

Volume

```
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-database-backup
  labels:
    tier: backend
    app: database-backup
spec:
  capacity:
    storage: 10Gi
  storageClassName: "nfs-client"
  accessModes:
    - ReadWriteMany
  nfs:
    server: nfs.example.com
    path: "/var/nfs/cluster-share/volumes/database-backup"

```

Volume Claim

```
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: yournamespace
  name: pvc-database-backup
  labels:
    tier: backend
    app: database-backup
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: "nfs-client"
  resources:
    requests:
      storage: 10Gi
  selector:
    matchLabels:
      tier: backend
      app: database-backup

```

Give it a try 🙂

Edit: Perhaps, the provisioner seems to be really stable. We use it now for longer than two years  
for different purposes (mostly backups) and never had any issues. Version upgrades worked  
without any problems too in the past.
