Question
How can we make the config server to not to pull from git every time a request comes from Client?
Whenever I scale my app, Config Server is pulling the git repo and I don't wanna pull the git repo regularly, I want the client app to get the configurations from the local cache(Eg: /tmp/config-repo, where config server pull by default).
Is there any way we could make the Config Server pull the Git repo on demand?
Can anyone please suggest?
Comment From: ryanjbaxter
Try setting spring.cloud.config.server.git.refreshRate
.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: dilipmighty245
Hi @ryanjbaxter
Thanks a lot, but the use case here is config server should not take clone git unless and until I forcefully refresh(manually). In other words, I want spring.cloud.config.server.git.refreshRate=infinty , meaning, I want application to take config properties from local cache only. Assume 5000 applications are scaling up and down in regular intervals, . so each time I scale an app, it should take from local repo only. our main goal is to lower the load on Gitlab server as much as possible.
Can you please suggest any workaround?
Thanks and regards, Dilip
Comment From: spencergibb
Set the refresh rate as high as possible, it should get you plenty of time between refreshes. We don't support checkout once and never update.
Comment From: dilipmighty245
@spencergibb thanks a lot for confirmation.
Comment From: deeravi
Hi @dilipmighty245, Were you able to find a work around to your problem ? I am facing a similar issue and would like to know if its possible to use a cache ?
Comment From: spencergibb
We don't support that. You could manually clone the repo and use a native environment repository
Comment From: sandeepvchowhan
I am not sure if this chat is still open, I set this property to spring.cloud.config.server.git.refreshRate=43200(12 hours), but I still see calls to GitHub very frequently from config server, this config server is serving 40+ app clients.
I am trying to ensure that calls to GitHub happen only twice a day regardless of the number of times the client apps restart (they should get the properties config server has at that time from the previous pull).
Comment From: tamilselvan-chinnaswamy
@sandeepvchowhan are you having health check to your config server ? at every health check it makes call to git. to avoid you can use this property spring.cloud.config.server.health.enabled=false
Comment From: nikolasvargas
Thank you @tamilselvan-chinnaswamy; I was having the same problem.