We have a spring boot application that is deployed to Kubernetes. We are adding i18n capabilities to this application and want to place the messages.properties file outside the application jar/war. I have been able to do that in spring boot. How will this work when I deploy it on Kubernetes? Do I need to use the configmaps? Following is the code snippet
@Configuration
public class AppConfig {
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
//Path to the messages.properties files
messageSource.setBasenames("file:/messages/messages", "classpath:messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(60);
return messageSource;
}
}