5 Controlling your configuration with Spring Cloud Configuration Server

 

This chapter covers

  • Understanding importance of separating the service configuration from the service code
  • Configuring a Spring Cloud configuration server
  • Integrating a Spring Boot microservice with a Config server
  • Encrypting sensitive properties
  • Integrating the Spring Cloud configuration server with Hashicorp Vault

Since we started our career as software developers, we have always heard the importance of having the application configuration separated from the code. But what does that mean? In most scenarios, this means not having hard-coded values in the code. Forgetting this principle can make the process of making changes within an application more complicated. Why? Because every time a change to the configuration is made, the application has to be recompiled and/or redeployed. To avoid this, developers need to separate the configuration information from the application code completely. Doing this allows developers to make changes to configuration without going through a recompile process, but also it introduces complexity because now developers have another artifact that needs to be managed and deployed with the application.

5.1      On managing configuration (and complexity)

 
 

5.1.1   Your configuration management architecture

 
 

5.1.2   Implementation choices

 
 

5.2      Building our Spring Cloud configuration server

 
 
 

5.2.1   Setting up the Spring Cloud Config Bootstrap class

 

5.2.2   Using Spring Cloud configuration server with the filesystem

 
 

5.2.3   Setting up the configuration files for a service

 

5.3      Integrating Spring Cloud Config with a Spring Boot client

 
 

5.3.1   Setting up the licensing service Spring Cloud Config service dependencies

 
 
 

5.3.2   Configuring the licensing service to use Spring Cloud Config

 
 
 

5.3.3   Wiring in a data source using Spring Cloud configuration server

 
 

5.3.4   Directly reading properties using the @Value annotation

 
 
 
 

5.3.5   Refreshing your properties using Spring Cloud configuration server

 
 

5.3.6   Using Spring Cloud configuration server with Git

 
 

5.3.7   Integrating Vault with Spring Cloud Config service

 
 

5.3.8   Vault UI

 
 
 
 

5.4      Protecting sensitive configuration information

 
 
 
 

5.4.1   Setting up a symmetric encryption key

 

5.4.2   Encrypting and decrypting a property

 
 
 
 

5.5      Closing thoughts

 
 
 

5.6      Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest