Miro
Miro

Reputation: 63

Spring Cloud Consul Configuration Versioning

I am trying to figure out how are you supposed to be versioning the Consul configurations.

My goal is to be able to prepare the production configurations for the next version without touching the existing ones. And also to be able to revert to the old configurations if I downgrade.

My first and only solution is to use the spring.cloud.consul.config.data-key

By default data-key=data, so the configurations would be:

config/testApp,dev/data
config/testApp/data
config/application,dev/data
config/application/data

I can change the key to be data-key=v1:

config/testApp,dev/v1
config/testApp/v1
config/application,dev/v1
config/application/v1

And on every configuration change, I will increment the version and everything should be fine.

But my idea breaks when there are many applications sharing the config/application* configurations

Maybe the solution is to not version the application configurations which is probably not possible with the current version of Spring Cloud Consul. Or maybe even not having common configurations at all?

Am I on the right track? Do I need to version my Consul configurations? How do you manage them?

Upvotes: 2

Views: 305

Answers (1)

Amit
Amit

Reputation: 703

It will easy if you check-in those config(production) in separate repository for example config_DEV, Config_Stage, Config_PROD maintain your repository based on which env it will get deployed.

Upvotes: 1

Related Questions