0

I'd like to set a config server which is able to use Vault and git as config backends. I don't quite figure out something about configuration:

spring:
  application:
    name: tdev-wssc-configserver

  profiles:
    active: git, vault

  cloud:
    config:
      server:
        git:
          uri: file:///path/to/git/repo
          order: 2
        vault:
          host: ${vault_server_host:localhost}
          port: ${vault_server_port:8200}
          order: 1
    vault:
      enabled: true
      host: ${vault_server_host:localhost}
      port: ${vault_server_port:8200}
      scheme: ${vault_server_scheme:https}
      connection-timeout: 5000
      read-timeout: 15000
      fail-fast: true
      config:
        order: -10
      ssl:
        trust-store: file:keystore.jks
        trust-store-password: secret

How come I need to set spring.cloud.config.server.vault and spring.cloud.vault?

Really should I need to set up both?

Which is the difference between them?

I only want that my clients are able to get configuration from config server straightforwardly, regardless of whether Vault is present.

So clients, only request on config server, and config server is engaged to get secrets from Vault.

Jordi
  • 20,868
  • 39
  • 149
  • 333

1 Answers1

3

If you want to use config server with both Git and Vault - use Spring Cloud Config and configure Vault in spring.cloud.config.server.vault section in your properties. See this documentation. In this case you should not add dependencies of Spring Cloud Vault, Spring Cloud Config already has Vault support ( VaultEnvironmentRepository class).

Spring Cloud Vault you can use in case you don't want to start your configuration server and just get properties from Vault directly from your service. It this case Spring Cloud Vault dependencies are used and spring.cloud.vault properties are used.

Based on your question it looks like that you want to have separate Configuration server so you should work with Spring Cloud Config.

Also this answer may be helpful for you.

nmyk
  • 1,582
  • 1
  • 8
  • 20