question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Common properties shared to all clients with multiple git config server

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
spencergibbcommented, Jul 3, 2018

so far just the composite.

2reactions
dsyercommented, May 13, 2016

Some of that makes sense. What I can’t get straight in my head (and why I haven’t done this myself) is that as soon as you have 2 repositories contributing to the same configuration Environment there’s a chance they don’t have the same labels. In fact I’d say it is necessary that individual teams can push new labels for their apps without having to change the global defaults. I think it means there is some tricky processing to do in the EnvironmentRepository, and I wouldn’t want to do that in the existing repository implementation. The best way to implement it is probably to keep the existing repository and fold it into a composite, which takes the output as it is now and prepends stuff from a default git repository (of which there is only one).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Cloud Config Server Shared Properties Across ...
It says: With file-based (i.e. git, svn and native) repositories, resources with file names in application* are shared between all client applications ( ......
Read more >
How to Use Multiple Git Configs on One Computer
How to Use Multiple Git Configs on One Computer · Step 1 → create separate directories for repos · Step 2 → create...
Read more >
2. Spring Cloud Config Server
If the repository is file-based, the server creates an Environment from application.yml (shared between all clients) and foo.yml (with foo.yml taking ...
Read more >
git-init Documentation - Git
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into...
Read more >
git config | Atlassian Git Tutorial
In this example, email is a child property of the user configuration block. This will return the configured email address, if any, that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found