spring-cloud / spring-cloud/spring-cloud-config

Common properties shared to all clients with multiple git config server

Open
#286 17 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

closable enhancement help wanted
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

Hey,

We have a quite complex setup of our configuration server. We have one repository per microservice to be able to manage access rights separately for each microservice.

We would like to _share configuration_ to all clients. We used to be able to do this using the native profile (as described here), but with changing to git as configuration storage, we seem to have lost that option.

I have tried using a combination of native and git, but that is not supported.
Next I tried to use the spring.cloud.config.server.git.uri property as a common repo, but that only acts as a fallback if spring.cloud.config.server.git.repos.* are not successfully matching configuration for a specific call to the config server.

My last option seemed using spring.cloud.config.server.git.overrides, which was working great, until I wanted to use variables such as this:

overrides:
          eureka.instance.statusPageUrlPath: ${server.contextPath}/info
          eureka.instance.healthCheckUrlPath: ${server.contextPath}/health
          info.configuration.uri: ${spring.cloud.config.uri}

Note: There seems to have been a lot of refactors in the org.springframework.cloud.config.server package, so I'm not sure the overrides property is still there.

The config server already fills in the variables before exposing them as json on the REST endpoints.
The result is that all clients receive the following:

  "propertySources": [
    {
      "name": "overrides",
      "source": {
        "info.configuration.uri": "${spring.cloud.config.uri}",
        "eureka.instance.statusPageUrlPath": "/configuration/info",
        "eureka.instance.healthCheckUrlPath": "/configuration/health"
      }
    }

So long story short, we are stuck. Either we continue to use the overrides configuration, and find a solution to passing the variables without being filled in by the config server itself, or we have to find another solution which allows us to share configuration to all clients while using a repository per microservice.

Cheers,
Andreas

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the config server REST endpoints and the spring.cloud.config.server.git.repos.* and spring.cloud.config.server.git.overrides properties described in the issue. Trace how common and per-microservice repositories are selected and how override variables are exposed; done means shared configuration works with separate repositories without unintended server-side variable resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java, spring, spring-boot
Domain
backend, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.