<p>I have a Raspberry Pi Cluster consisting of 1-Master 20-Nodes:</p>
<ul>
<li>192.168.0.92 (Master)</li>
<li>192.168.0.112 (Node w/ USB Drive)</li>
</ul>
<p>I mounted a USB drive to <code>/media/hdd</code> &amp; set a label <code>- purpose=volume</code> to it.</p>
<p>Using the following I was able to setup a NFS server:</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
  name: storage
  labels:
    app: storage
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: local-pv
  namespace: storage
spec:
  capacity:
    storage: 3.5Ti
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: /media/hdd
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: purpose
          operator: In
          values:
          - volume
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: local-claim
  namespace: storage
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: local-storage
  resources:
    requests:
      storage: 3Ti
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs-server
  namespace: storage
  labels:
    app: nfs-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nfs-server
  template:
    metadata:
      labels:
        app: nfs-server
        name: nfs-server
    spec:
      containers:
      - name: nfs-server
        image: itsthenetwork/nfs-server-alpine:11-arm
        env:
          - name: SHARED_DIRECTORY
            value: /exports
        ports:
          - name: nfs
            containerPort: 2049
          - name: mountd
            containerPort: 20048
          - name: rpcbind
            containerPort: 111
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /exports
            name: mypvc
      volumes:
        - name: mypvc
          persistentVolumeClaim:
            claimName: local-claim
      nodeSelector:
        purpose: volume
---
kind: Service
apiVersion: v1
metadata:
  name: nfs-server
  namespace: storage
spec:
  ports:
    - name: nfs
      port: 2049
    - name: mountd
      port: 20048
    - name: rpcbind
      port: 111
  clusterIP: 10.96.0.11
  selector:
    app: nfs-server
</code></pre>
<p>And I was even able to make a persistent volume with this:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mysql-nfs-volume
  labels:
    directory: mysql
spec:
  capacity:
    storage: 200Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: slow
  nfs:
    path: /mysql
    server: 10.244.19.5
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-nfs-claim
spec:
  storageClassName: slow
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Gi
  selector:
    matchLabels:
      directory: mysql
</code></pre>
<p>But when I try to use the volume like so:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: wordpress-mysql
  labels:
    app: wordpress
spec:
  ports:
    - port: 3306
  selector:
    app: wordpress
    tier: mysql
  clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress-mysql
  labels:
    app: wordpress
spec:
  selector:
    matchLabels:
      app: wordpress
      tier: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: wordpress
        tier: mysql
    spec:
      containers:
      - image: mysql:5.6
        name: mysql
        env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql
      volumes:
      - name: mysql-persistent-storage
        persistentVolumeClaim:
          claimName: mysql-nfs-claim
</code></pre>
<p>I get NFS version transport protocol not supported error.</p>

Proximo
<p>When seeing <strong><code>mount.nfs: requested NFS version or transport protocol is not supported</code></strong> error there are three main reasons:</p>
<blockquote>
<ol>
<li>NFS services are not running on NFS server</li>
<li>NFS utils not installed on the client</li>
<li>NFS service hung on NFS server</li>
</ol>
</blockquote>
<p>According tho <a href="https://kerneltalks.com/troubleshooting/mount-nfs-requested-nfs-version-or-transport-protocol-is-not-supported/" rel="nofollow noreferrer">this artice</a> there are three solutions to resolve the problem with your error.</p>
<p><strong>First one:</strong></p>
<p>Login to the NFS server and check the NFS services status. If the following command
<code>service nfs status</code> returns an information that NFS services are stopped on the server - just start them using <code>service nfs start</code>. To mount NFS share on the client use the same command.</p>
<p><strong>Second one:</strong></p>
<p>If after trying first solution your problem isn't resolved</p>
<blockquote>
<p>try <a href="https://kerneltalks.com/tools/package-installation-linux-yum-apt/" rel="nofollow noreferrer">installing package</a> nfs-utils on your server.</p>
</blockquote>
<p><strong>Third one:</strong></p>
<blockquote>
<p>Open file  <code>/etc/sysconfig/nfs</code>  and try to check below parameters</p>
</blockquote>
<pre><code># Turn off v4 protocol support
#RPCNFSDARGS=&quot;-N 4&quot;
# Turn off v2 and v3 protocol support
#RPCNFSDARGS=&quot;-N 2 -N 3&quot;
</code></pre>
<blockquote>
<p>Removing hash from <code>RPCNFSDARGS</code> lines will turn off specific version support. This way clients with mentioned NFS versions won’t be able to connect to the NFS server for mounting share. If you have any of it enabled, try disabling it and mounting at the client after the NFS server service restarts.</p>
</blockquote>
