<p>I am trying to mount an NFS volume to my pods but with no success.</p>

<p>I have a server running the nfs mount point, when I try to connect to it from some other running server </p>

<p><code>sudo mount -t nfs -o proto=tcp,port=2049 10.0.0.4:/export /mnt</code> works fine</p>

<p>Another thing worth mentioning is when I remove the volume from the deployment and the pod is running. I log into it and i can telnet to 10.0.0.4 with ports 111 and 2049 successfully. so there really doesnt seem to be any communication problems</p>

<p>as well as: </p>

<blockquote>
<pre><code>showmount -e 10.0.0.4
Export list for 10.0.0.4:
/export/drive 10.0.0.0/16
/export       10.0.0.0/16
</code></pre>
</blockquote>

<p>So I can assume that there is no network or configuration problems between the server and the client (I am using Amazon and the server that i tested on is in the same security group as the k8s minions)</p>

<p>P.S: 
The server is a simple ubuntu->50gb disk</p>

<p>Kubernetes v1.3.4</p>

<p>So I start creating my PV</p>

<blockquote>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs
spec:
  capacity:
    storage: 50Gi
  accessModes:
    - ReadWriteMany
  nfs:
    server: 10.0.0.4
    path: "/export"
</code></pre>
</blockquote>

<p>And my PVC</p>

<blockquote>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nfs-claim
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 50Gi
</code></pre>
</blockquote>

<p>here is how kubectl describes them:</p>

<blockquote>
<pre><code>  Name:       nfs
    Labels:     &lt;none&gt;
    Status:     Bound
    Claim:      default/nfs-claim
    Reclaim Policy: Retain
    Access Modes:   RWX
    Capacity:   50Gi
    Message:
    Source:
        Type:   NFS (an NFS mount that lasts the lifetime of a pod)
        Server: 10.0.0.4
        Path:   /export
        ReadOnly:   false
    No events.
</code></pre>
</blockquote>

<p>AND</p>

<blockquote>
<pre><code>  Name:       nfs-claim
    Namespace:  default
    Status:     Bound
    Volume:     nfs
    Labels:     &lt;none&gt;
    Capacity:   0
    Access Modes:
    No events.
</code></pre>
</blockquote>

<p>pod deployment:</p>

<blockquote>
<pre><code>  apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: mypod
      labels:
        name: mypod
    spec:
      replicas: 1
      strategy:
        rollingUpdate:
          maxSurge: 1
          maxUnavailable: 0
        type: RollingUpdate
      template:
        metadata:
          name: mypod
          labels:
            # Important: these labels need to match the selector above, the api server enforces this constraint
            name: mypod
        spec:
          containers:
          - name: abcd
            image: irrelevant to the question
            ports:
            - containerPort: 80
            env:
            - name: hello
              value: world
            volumeMounts:
            - mountPath: "/mnt"
              name: nfs
          volumes:
            - name: nfs
              persistentVolumeClaim:
                claimName: nfs-claim
</code></pre>
</blockquote>

<p>When I deploy my POD i get the following:</p>

<blockquote>
<pre><code>Volumes:
      nfs:
        Type:   PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
        ClaimName:  nfs-claim
        ReadOnly:   false
      default-token-6pd57:
        Type:   Secret (a volume populated by a Secret)
        SecretName: default-token-6pd57
    QoS Tier:   BestEffort
    Events:
      FirstSeen LastSeen    Count   From                            SubobjectPath   Type        Reason      Message
      --------- --------    -----   ----                            -------------   --------    ------      -------
      13m       13m     1   {default-scheduler }                            Normal      Scheduled   Successfully assigned xxx-2140451452-hjeki to ip-10-0-0-157.us-west-2.compute.internal
      11m       7s      6   {kubelet ip-10-0-0-157.us-west-2.compute.internal}          Warning     FailedMount Unable to mount volumes for pod "xxx-2140451452-hjeki_default(93ca148d-6475-11e6-9c49-065c8a90faf1)": timeout expired waiting for volumes to attach/mount for pod "xxx-2140451452-hjeki"/"default". list of unattached/unmounted volumes=[nfs]
      11m       7s      6   {kubelet ip-10-0-0-157.us-west-2.compute.internal}          Warning     FailedSync  Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "xxx-2140451452-hjeki"/"default". list of unattached/unmounted volumes=[nfs]
</code></pre>
</blockquote>

<p>Tried everything I know, and everything i can think of. What am i missing or doing wrong here?</p>

<p>I tested version 1.3.4 and 1.3.5 of Kubernetes and NFS mount didn't work for me. Later I switched to the 1.2.5 and that version gave me some more detailed info ( kubectl describe pod ...). It turned out that 'nfs-common' is missing in the hyperkube image. After I added nfs-common to all container instances based on hyperkube image on master and worker nodes the NFS share started to work normally (mount was successful). So that's the case here. I tested it in practice and it solved my problem.</p>
