How to run/deploy Spring Boot Microservice from IntelliJ into local Kubernetes cluster?

4/10/2020

I have a local Kubernetes cluster running, and I'm working on Spring Boot Microservices from IntelliJ. Is there a way I can deploy the Microservice Docker images directly into that Kubernetes cluster by just hitting 'Run' for regular development and debugging?

WHY In the environment, one microservice can call another service with,

http://another-service:80

but everytime I need to run the service from local, I have to change all references to:

http://localhost:<some-port>

I understand I can use local config but there are similar issues. If I am able to do this, I can replicate production into the local machine as well.

I tried various IDE plugins, the docker files I have works fine into production but not sure what I can proceed with on local. I know this is quite wide question.

-- Shubham A.
docker
intellij-idea
kubernetes
microservices
spring-boot

1 Answer

4/10/2020

You can use google cloud code extension plugin for IntelliJ to deploy spring boot apps to a Kubernetes cluster. This uses skaffold internally which handles the workflow for building, pushing and deploying your application to kubernetes cluster.

https://cloud.google.com/code/docs/intellij/deploying-a-k8-app

-- Arghya Sadhu
Source: StackOverflow