-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Spring Config Server #226
base: master
Are you sure you want to change the base?
Conversation
Hi @eaglerainbow, I see you're an active contributor to this project. Is it possible to merge this? It's a fairly small commit, and just adds another piece of the Spring project. Thanks! |
Thanks for the contribution! I don't see anything speaking against your PR in principle. The point is that it requires some sort of integration testing as part of the delivery pipeline. Background to this is that in the past, I have made bad experience on this w.r.t. encrypted passwords and the spring cloud CLI. |
Would you also need this in the 0.x.y series? |
I am currently reading https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-first-bootstrap. Looks like that they suggest a newer approach of inclusion:
Is the difference intentional? |
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-bootstrap</artifactId> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently trying to wrap my head around this dependency. I think it refers to https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-first-bootstrap.
If I get things right, then with this dependency, we would automatically being connecting to a localhost:8888 trying to fetch there. This is a somewhat incompatible behavior, because we don't know in which environment Promregator is running: It may be that other spring-boot applications are using a local config server, but because Promregator did not in the past, we would be suddenly taking configuration values from there, potentially causing confusion. If with bad luck, this could even end up in a security flaw being introduced (hopefully, this wouldn't happen, though).
Essentially, what is currently on my mind is to facilitate this feature, but to not have it enabled by default. I am currently asking myself, if the option of using Spring Boot Config Data Import isn't the better way.
Just found out by trying: Adding fwiw: I am currently playing around at https://github.com/promregator/promregator/tree/cloudConfigServer (cf https://github.com/promregator/promregator/compare/cloudConfigServer ) |
It's 4 lines to add the dependency, but it's another 360 lines to test/ensure that you don't break delivery (with config support enabled and disabled). See also https://github.com/promregator/promregator/tree/68acae0f7e06110211c85c0a54efc74a4362d9c7 . If we can agree on this newer spring cloud config server configuration approach, I think "only" documentation and mentioning in the feature list would be missing. |
Hi @eaglerainbow and thanks for your reply. I must admit I hadn't noticed the new Spring Boot property for Config Server. I will test this shortly. The JAR has been in my applications since before Spring 2.4. I am happy to add documentation to the PR, though if the new method of just adding a property to a Spring Boot app works without adding a maven dependency, I am also happy to close this PR. Let me know if you'd still like the feature mentioned in docs, I can do that. |
I think you are getting a little ahead of yourself 😁
which I take that the HTTP interface for accessing the spring cloud config server in the client isn't available.
I am currently for doing it. However, please note that this PR here is deprecated. I think, we should continue on my branch where also integration tests are included (which just helped perfectly fine to cross-check whether Do you want to take the documentation stuff up from there? Line 198 in 390b6a1
|
Eventually, my plan would be to merge my branch into master (either directly or via PR, I don't know yet). Ah, and one more thing:
Do you have an opinion about that? |
If you're referring to the 0.x.y release version of Promregator then no, I personally use latest. I don't have an opinion either way. |
Okay, then let's keep this on 1.0.x for the time being. |
Current Situation
Promregator does not support the Spring Cloud Config Server, which allows externalized configuration to be fetched from a service using HTTP requests.
Problem Statement
This PR simply adds an additional way to configure Promregator using a well known and supported method from the Spring project.
Solution Approach
Add the dependencies for the Spring Cloud Config Server to the pom.xml.
To make use of the Spring Cloud Config Server in Promregator, simply add the application property:
If you are deploying Promregator to Cloud Foundry, you can simply add the environment variable: