'Deploying Spring Boot application to Kubernetes (Openshift) with application-prod.yml

I’m trying to deploy a spring boot app to kubernetes (openshift) and I’m struggling to configure the application with a profile, to automatically load the application-profile.yml. My image is an s2i that pulls my repo successfully (the application-prod.yml is in the git repo), and I’m trying to configure the profile and the path from the JVM options.

When I try: -Dspring.profile.active=prod -Dspring.config.location=/build/resources/main/config/ it doesn’t work. Only the profile parameter gets loaded, but the application-prod.yml doesn’t



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source