<p>Our application landscape consists of Spring Boot apps hosted on docker containers managed by Kubernetes. 
In Spring Boot, we use the property "spring.config.location" to specify the external location of the property files. The java command is as follows:
java -jar myproject.jar --spring.config.location={file://some file path}</p>

<p>Now instead of using the local file path, can I create a Kube persistent volume and give that path in the above command?
What Kube volume type should I use to allow for the same semantics of file://{file path} ?</p>

<p>We could successfully read application.properties file from a Kubernetes Persistent Volume using the "spring.config.location" command line argument. The steps we followed were as follows: </p>

<ol>
<li><p>Created a persistent volume on Kubernetes (PVC was set to ReadWriteMany option, as multiple microservices will use the same properties file). </p></li>
<li><p>Mounted the volume to the Pod of each microservice (changes in the pod script file). Mounted file system accessible via - '/shared/folder/properties' path. </p></li>
<li><p>Added the "spring.config.location" parameter to the "java -jar" command - e.g. java -Dspring.profiles.active=$spring_profile  -Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -jar myJar.jar --spring.config.location=file:/shared/folder/properties</p></li>
</ol>
