<p>I was able to get it working following NFS example in Kubernetes.</p>

<p><a href="https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/nfs" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/nfs</a></p>

<p>However, when I want to automate all the steps, I need to find the IP and update <code>nfs-pv.yaml</code> PV file with the hard coded IP address as mentioned in the example link page.</p>

<blockquote>
  <p>Replace the invalid IP in the nfs PV. (In the future, we'll be able to
  tie these together using the service names, but for now, you have to
  hardcode the IP.)</p>
</blockquote>

<p>Now, I wonder that <strong>how can we tie these together using the services names</strong>?</p>

<p>Or, <strong>it is not possible</strong> at the latest version of Kubernetes (as of today, the latest stable version is <a href="https://github.com/kubernetes/kubernetes/releases" rel="nofollow noreferrer">v1.6.2</a>) ?</p>

<p>You can use do this with the help of <code>kube-dns</code>, 
check whether it's service running or not,</p>

<p><code>
kubectl get svc --namespace=kube-system
</code></p>

<p>and kube-dns pod also,</p>

<p><code>
kubectl get pods --namespace=kube-system
</code></p>

<p>you have to add respected name-server according to kube-dns on each node in cluster,
For more troubleshooting, follow this document,
<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a></p>
