Search code examples
springspring-cloudspring-cloud-configconfigserver

ConfigServer clones the whole branch from gitlab creating space issue in PCF


In My project we want to use existing gitlab project repo for the config server rather than maintaining a different repo for a particular service. Now we have deployed the config server in PCF with 1 GB of disk space but looks like 1 GB is not enough. When config server clone the repo it crosses 1GB and it makes the application down. I am looking for a solution where i can configure config server to check out folders which only contains the property files.

Background: I tried to run config server in local for the same repo checked out default branch size is around 900 mb

spring:
   cloud:
      config:
         server:
            git:
               uri: https://**********************.git
               username: *****
               password: **
               searchPaths: AAA/ABA*
               default-label: develop
               skipSslValidation: true
   application:
      name: ConfigServer

Solution

  • I don't think spring cloud config server git integration supports "partial" checkouts or something, I would be glad to be proven otherwise.

    So basically your options are:

    1. If you want to use git to store the configurations: create a dedicated repository for configurations. It will be pretty small so the problem will disappear by itself. For me its the most reasonable solution, since the configuration are supposed to be decoupled from the source code anyway

    2. Don't use git as a source of configuration, instead consider using the filesystem and create a custom method (maybe external to the service itself) to get the configurations from git, maybe with the help of git archive command

    3. Kind of integration of idea 2 into the config server itself. Basically you can create your own custom environment repository so that there won't be a need in any kind of external process which is an obvious drawback of method '2'. The question of how to actually do this is java has been already answered in SO