Where is the NFS volume located on a kubernetes Node?

8/16/2017

I've been using https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md as a guide.

I've successfully set the above working. However I'm not able to locate where the actual "NFS Volume" is located at - I'm guessing it's just an ordinary directory.

I have two goals here:

  • To prepopulate the volume / directory initially
  • To make a backup of this volume / directory

nfs-pvc.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 1Mi
-- Chris Stryczynski
kubernetes
nfs
persistent-volumes

1 Answer

8/16/2017

This deployment is GCE specific NFS. NFS server run as POD in the cluster image: gcr.io/google_containers/volume-nfs:0.8

looks at this deployment file https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-server-rc.yaml

This pod acts as NFS server. if you run `kubectl get pods' you will see nfs-server pod is running.

volume-nfs: is google image, not familer with all the features. I can see the kubectl cp option to copy the file to and from the NFS server POD.

https://kubernetes.io/docs/user-guide/kubectl/v1.7/#cp

eg:

kubectl cp /tmp/foo <some-namespace>/nfs-server:/exports

The above command will only work if the tar executable is present on the container.

-- sfgroups
Source: StackOverflow