Reputation: 1
I have a microservice environment where all services use Spring and fetch configs from Spring Cloud config. The thing is that all environments (dev, qa, prod)
fetch configs from master (appcustomer-dev.yml
, appcustomer-qa.yml
, appcustomer-prod.yml
). So whenever any property is merged to master, it becomes available for all applications in all environments. I would like some way of ensuring more security for this, like having release tag branches/commits that can be used by prod for example, and not fetching it directly on master whenever something is merged, is there a pattern way of doing this?
One solution: have a branch for each environment (development / qa / prod) so any time properties are merged on these, it gets available for the specific environment.
but I was thinking about versioning for example: I did a change on many properties but if something goes wrong, I want to rollback these in a simpler way and also keep track of the changes by using some kind of release tag that has a specific commit in the history so we could just switch the application client to use this tag in some way.
Do you guys have any idea of how I could do this using Spring Cloud config server/clients + git branches?
I was using the solution in the description and wanted some kind of versioning on these properties.
Upvotes: 0
Views: 295
Reputation: 159
you can switch branches on client-side using:
spring.cloud.config.label
https://stackoverflow.com/a/34208724/1961312
if you want versioning, i would suggest to start a second configserver with a specified label to e.g. a tag:
This repository implementation maps the {label} parameter of the HTTP resource to a git label (commit id, branch name, or tag). If the git branch or tag name contains a slash (/), then the label in the HTTP URL should instead be specified with the special string (_) (to avoid ambiguity with other URL paths).
https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html
Upvotes: 0