<p>I have added a NFS volume mount to my Spring Boot container running on Kubernetes. Below is my deployment file for Kubernetes.</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata: 
  labels: 
    app: ldap
spec: 
  replicas: 3
    spec: 
      serviceAccountName: xxx-staging-take-poc-admin
      volumes:
        - name: nfs-volume
          nfs:
           server: 10.xxx.xxx.xxx
           path: /ifs/standard/take1-poc 
      containers: 
        - 
          image: image-id
          volumeMounts:
            - name: nfs-volume
              mountPath: /var/nfs
          name: ldap
</code></pre>

<p>How do I access the mount path from my Spring Boot application to achieve file read and write.</p>

<p>If I understand you correctly you can pass external info to sprint boot application through environment variables. <a href="https://dzone.com/articles/configuring-spring-boot-on-kubernetes-with-configm" rel="nofollow noreferrer">Here</a> is an article with more detailed info of how to do it. </p>

<blockquote>
  <p>Kubernetes ConfigMaps also allows us to load a file as a ConfigMap
  property. That gives us an interesting option of loading the Spring
  Boot application.properties via Kubernetes ConfigMaps.</p>
</blockquote>

<p>Also, you may want to get familiar with <a href="https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.3/html/fuse_integration_services_2.0_for_openshift/kube-spring-boot" rel="nofollow noreferrer">this documentation</a>. It shows how to reference secrets which are also mounted so you may find it helpful in your case.</p>

<blockquote>
  <p>The Spring Cloud Kubernetes plug-in implements the integration between
  Kubernetes and Spring Boot. In principle, you could access the
  configuration data from a ConfigMap using the Kubernetes API.</p>
</blockquote>

<p>Please let me know if that helped. </p>
