Having the following composite setup for config server (2021.0.0, Boot 2.6.3)
$ curl https://start.spring.io/starter.tgz -d dependencies=cloud-config-server,cloud-starter-vault-config \
-d language=java -d type=maven-project -d baseDir=spring-cloud-config-server | tar -xzvf -
Annotated the class with @EnableConfigServer
.application.yml
spring:
cloud:
vault:
# [Vault] token
token: vault-plaintext-root-token
config:
server:
composite:
- type: vault
kv-version: 2
- type: git
uri: https://github.com/marcingrzejszczak/config-server-properties
profiles:
# [Vault & git]
active: composite
# default port
server.port: 8888
Inserting such vault entries
$ vault kv put secret/bar,foo a="bar with foo profile value from Vault"
Having such git repo
.bar-foo.properties
a=default with foo profile value from git
When sending a request to retrieve the properties for app bar
with profile foo
I get back a
from git not from vault
curl localhost:8888/bar-foo.properties -H "X-Config-Token: vault-plaintext-root-token"
When I remove git from the composite setup I get a
equal to bar with foo profile value from Vault
Comment From: dantonyuk
@marcingrzejszczak Please try this:
spring:
cloud:
config:
server:
vault:
order: 1
...
git:
order: 2
...
and use profile git,vault
.
Comment From: marcingrzejszczak
I did try it out and the only difference was that I had vault,git
as profile orders. I'll need to double check my setup in general.
Comment From: dantonyuk
Yeah, there was some glitch with a profile order. Try git,vault
instead.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.