0

The documentation here shows that, the config server can be configured to use vault as its backend, by simply setting the property below, in application.properties

spring.profiles.active=vault

Even after doing so, when a Embedded config server starts up, it expects a Git repository to be configured as below:

spring.cloud.config.server.git.uri=repo_url

It fails with the below exception, without the git repo property set.

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 
'environmentRepository' defined in class         org.springframework.cloud.config.
server.config.
EnvironmentRepositoryConfiguration$GitRepositoryConfiguration: 
Invocation of init method failed; 
nested exception is java.lang.IllegalStateException: 
You need to configure a uri for the git repository

I am not sure how to get the config server look up the vault server running at localhost:8200.

Khoa Phung
  • 491
  • 3
  • 9
  • 20
BatScream
  • 19,260
  • 4
  • 52
  • 68
  • It's not released yet and is only available in snapshots. – spencergibb Aug 15 '16 at 22:04
  • @spencergibb - Thanks for your response. I tried using the snapshots available in the maven repo. How do you suggest integrating vault with spring applications for storing secured database credentials? – BatScream Aug 15 '16 at 22:10
  • Have you read this article for more context? https://spring.io/blog/2016/06/24/managing-secrets-with-vault – Shawn Clark Aug 16 '16 at 04:09

1 Answers1

0

When use vault as backend you have to add the vault server info in config server (application.yml)

spring:
  cloud:
    config:
      server:
        vault:
          port: 8200
          host: 127.0.01

Then add the authentication token in config client (bootstrap.yml)

spring:
  cloud:
    config:
      token: myroot

Ref: https://cloud.spring.io/spring-cloud-config/single/spring-cloud-config.html#vault-backend https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_client.html#_vault

Khoa Phung
  • 491
  • 3
  • 9
  • 20