I am exploring Heroku. I have a project which has 10 micro services. One of which is a configuration server which takes care of managing configuration for all services using git hub.
I want to use Heroku for deploying these services but I am not sure how would my Spring Boot Configuration Server would work as Heroku provides a way to configure each hosted app separately(Can configure DB settings for individual app).
Any suggestions/ thoughts would be appreciated.
I found solution to my problem, sharing it for a reference.
Just need to use the addons on Heroku and use the addons config details in any of my config file which can be easily managed by the config server through git.
For an instance, if you are having a addon of Postgres, you would get configuration from Heroku for it(url, username, password etc). Use this information in the configuration file which is being managed by config server.
Related
Developing microservices using Spring Boot, and are currently working on containerizing our applications. However, I can't seem to figure out best practices for Cloud Config client.
How do I best update the cloud config server for the docker container?
Thanks!
In practice, the your containerized config application should be pulling the config from some centralized repository where configs are checked in and from there your microservices or containerized app will pull the config for further process.
I have two microservices. A Spring Cloud Config Server and another module that implements Spring Cloud Config Client. When I use the default configuration for the Spring Cloud Config Server service (localhost:8888) I can start it locally without any issues, after which I can start my other module as well, using a bootstrap.yml, it clearly finds the Config Server, fetches its properties and starts properly. All good. Now I'd like to push both of these services to Pivotal Cloud Foundry.
The Config Server service works just fine, service is up and running in my Space, and using the browser I can verify that it can still fetch the property files from the specific GitHub repository.
The problem is the other module, the client. I've replaced the default localhost:8888 in its bootstrap.yml file (spring.cloud.config.url parameter) to the now active service in the cloud using the Route bound to it and tried to start it locally. Unfortunately now it simply timeouts during startup. At this point I tried to specify longer timeouts but nothing helps.
Interesting thing is that if I directly copy the URL from the logs that timeouts I see it works properly in the browser locally. So why not in IntelliJ when I try to package the client with the changed parameter?
Sorry, I can't include much details here, but I hope maybe there is a straightforward solution that I've missed. Thanks!
I am confused when to use spring cloud config server and consul.
Both will read configurations files in their own ways.
Can you please let me know when use spring cloud config server and when to use consul?
Both serve configuration from remote servers to spring boot applications. Config Server aggregates configuration from multiple sources: git, svn, sql databases, vault and credhub. Spring Cloud Consul serves configuration to boot apps directly from the consul key-value store. If you already have consul in your infrastructure, it would simplify things by not having to run config server.
Currently I'm working on a Spring Boot 2 project where we use Heroku as our Cloud Service. We push our changes to Github and our instance on Heroku cloud gets provisioned and deployed. After participating Javaday in my city, I attended to a speech and got to know about this amazing framework, Keycloak. After some investigation, we have decided using Keycloak as our identity and access management.
From what I understand, we need to start a Keycloak standalone server as explained here https://www.keycloak.org/docs/latest/server_installation/index.html.
But the problem is, we cannot access to filesystem on Heroku instance and thus, cannot extract the Keycloak files and start the server.
I tried to follow these steps https://github.com/yurtsevich/keycloak-swarm-heroku yurtsevich has provided but I noticed that latest version of Keycloak Swarm is not compatible with Spring Boot 2.
Can we start Keycloak server on the same Heroku instance we have? I'm unable to find any solution to this at this moment.
Edit: this button from readme will deploy Keycloak on Heroku with free dynos: https://github.com/sannonaragao/keycloak-heroku
This button deploys the lastest version straight to Heroku.
https://elements.heroku.com/buttons/mieckert/keycloak-heroku
Beware! It deploys at the Performance-M dyno, you must change to free right after if you don't want to pay some use fee.
When I run JHipster Registry in the cloud (ex: Heroku) and runs without problems and I can access correctly through the URL (ex: my-jhipster-registry.herokuapp.com). I could use this JHipster Registry to manage JHipster Microservices (gateways or applications) that are not in the cloud? If this is possible, how?
This doubt arises from the need to NOT have install JHipster Registry locally (on my laptop) during development and read the official guide running in the cloud.
Scenario expected during development:
JHipster Registry in cloud (Heroku)
JHipster Microservices in local (laptop)
I thank you for your time and help!
Yes it should work as long as your services can connect to your registry and they expose IP addresses that can be reached by other services (a service running in the cloud will not be able to connect to a service running on your laptop).
You may need a real certificate on registry that match your domain name for using https.