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.
Related
I created a full stack application (Angular front end, java spring boot back end, mysql database), and I was able to upload successfully both the angular files and mysql into BanaHost cPanel, however I have not found useful information on how to upload spring boot REST API, as a consequence only the front end is working. How can I deploy this REST API on cpanel?
Spring Boot Applications can't just upload and deploy if you're utilizing a cPanel Web hosting (shared) plan, like you deployed the Angular Application by uploading.
For spring boot you must do it yourself, a Virtual Private Server or Dedicated Server will unlock the site hosting restriction. If you are not much familiar with the Linux command line, you can use a Window VPS instead. Providers like, Digital Ocean, Linode, and Oracle Cloud all provide free trials.
And also, there are platforms, such as Heroku (Platform as a Service(PaSS)), where you can deploy your app without the need for a VPS. You can refer their documentation regarding this:
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
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 got a query to ask you all. I am looking for guides that help me deploy my spring boot application on google cloud computer engine, I type in my instance IP address when I test my spring boot application I unable to access it in REST API.
May I know do you have any guides or steps for me to follow to deploy successfully in google cloud computing engine. Why do I need to deploy in computer engine is because I deployed my angular at it and I deploy it both it seems that my angular project being replaced by my spring boot application.
Codelabs GCP / Spring series has deployment tutorials:
https://codelabs.developers.google.com/spring/
GCP has some "Getting Started" tutorials you can use here:
https://cloud.google.com/java/docs/
where the specific one for deploying a java app to GCE is here:
https://cloud.google.com/java/docs/tutorials/bookshelf-on-compute-engine
But the basic steps are as follows:
Write your Spring app
Build your Spring app
Run / test your jar locally
Push your jar to a location in Storage
Create a startup script for your GCE instance
Create a new GCE VM which uses your startup script using Console, Deployment API, or gcloud tool
After that, you need to ensure you have the proper network rules in place to be able to access your API publicly. If you do not wish to learn how to use GCE, I would suggest you look into using App Engine instead because then you do not need to learn how to deploy and instead can concentrate on your api. Here is a guide to do that
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.
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.