Is there a way of Service Discovery that works on localhost and Kubernetes without changing a line of code?

4/8/2019

I’m currently working with spring boot and kubernetes and came across a problem. I’ve already implemented service discovery in spring boot with spring-boot-cloud-kubernetes and it’s working fine, but (and this is something I’m not stoked about) I have to redeploy my microservices to minikube every time I want to observe the changes. Is there a way to use local service discovery (localhost) that also works within kubernetes without using Eureka, etc?

-- Only X
kubernetes
spring
spring-boot

2 Answers

4/9/2019

Use k8s services that point to respective endpoints. You can always change the service endpoints and will be reflected any time there are changes to services.

-- Akash Sharma
Source: StackOverflow

4/8/2019

You could use Consul in combination with consul-template or envconsul to do service discovery and config file templating, including automatic restarting of the application if required.

-- DWSR
Source: StackOverflow