java - Include common config for multiple apps in Spring Cloud Config server -
i'm trying migrate our stable of app servers configuration spring cloud config server. each app has {my-app}.yml
file on config server , can use profiles (either in files named {my-app}-{profile}.yml
or using multi-profile yaml documents) have different configuration per environment each app, , can include 1 profile in using spring.profiles.include
provide sort of inheritance - far, good.
however, can include profiles from same app in each other , have several apps configured same config server share lot of config per environment - instance use same datasource config connect same database , likewise messaging, cache , on. that's lot of duplicated config , lot of places needs changed - precisely spring cloud config supposed avoid!
is there way "include" (via profiles or otherwise!) shared config properties across apps in spring cloud config server?
update
in addition correct answer @vladsfl below, beware if you're using native profile on config server serve config filesystem or classpath instead of git repo, config server use application.yml , profile variants refuse serve them out other apps. solution use spring.cloud.config.server.native.searchlocations
pull served config different location.
yes. can have application.yml
or application-<profile>.yml
on config server , every application using config server inherit settings in application.yml
. every application runs in specific profile inherit settings application-<profile>.yml
.
Comments
Post a Comment