Spring Cloud Config Server supports CredHub as a backend for configuration properties. You can enable this feature by adding a dependency to Spring CredHub.
pom.xml
The following configuration uses mutual TLS to access a CredHub:
spring:
profiles:
active: credhub
cloud:
config:
server:
credhub:
url: https://credhub:8844
The properties should be stored as JSON, such as:
credhub set --name “/demo-app/default/master/toggles” --type=json
value: {“toggle.button”: “blue”, “toggle.link”: “red”}
credhub set --name “/demo-app/default/master/abs” --type=json
value: {“marketing.enabled”: true, “external.enabled”: false}
All client applications with the name spring.cloud.config.name=demo-app will have the following properties available to them:
{
toggle.button: “blue”,
toggle.link: “red”,
marketing.enabled: true,
external.enabled: false
}
When no profile is specified default will be used and when no label is specified master will be used as a default value. NOTE: Values added to application will be shared by all the applications.