Spring Configuration Server Cloud setup

146 Views Asked by At

I am using Spring Configuration server and currently my configurations are in git as per the documentations for configuration server. Now my problem is that my prod and stage env does not have access to git hence getting the properties from git directly is a problem as my git is hosted on prem. The solution which I found is that to include all my properties in configuration server image itself (We have a docker image for each application including config server) . This is something which I dont want to do as this will require a new image deployment everytime the confgiuration value changes which is not the ideal use for configuration store. I can use a GCP bucket some other solution which can be used on Google Cloud and where I can deploy as a build packet.

Thanks,

Amol

2

There are 2 best solutions below

0
On BEST ANSWER

Here is what I did.

  • Used config server can access git either by URL or a system location.
  • I mounted a google cloud bucket on the server my application is running on using gcsfuse(I am using kubernetes and added gcsfuse inside container) and used that as a repo location in config server url like below

    spring.cloud.config.server.git.repos.my-app.uri=file://${configuration.store.path}

  • Create a process(Jenkins job) inside my network which has access to git and mounted the same GCS bucket here as well. The Job keeps updating the bucket with the latest config from repo and it is automatically available to my Server.

0
On

Now my problem is that my prod and stage env does not have access to git

Then Config Server will not be useful in your stage or production environments. You'll need to re-architect a solution.