Skip to content

A simple Spring Boot service that shows how to use Kubernetes ConfigMap in Spring Boot properties

License

Notifications You must be signed in to change notification settings

redhat-developer-demos/spring-boot-greeter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Config

This example shows how to bootstrap kubernetes ConfigMap to the Spring Boot properties

Build and Deploying

./mvn clean fabric8:deploy

oc get pods -w (1)
  1. Ensure the application is deployed and available to run

Accessing application

Find the route of the applicaiton using the command oc get route spring-boot-greeter, and try the following

curl $(oc get route spring-boot-greeter | awk 'END{print $2}')/greet/<name>

This should display the greeting with prefix configured for property greeter.prefix cm.yaml

Applying changes

Edit the config map via oc edit configmap spring-boot-greeter and change the greeter.prefix, you will notice the spring boot application redeployed. Any new calls to the API will have the updated greeter.prefix

About

A simple Spring Boot service that shows how to use Kubernetes ConfigMap in Spring Boot properties

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages