Only X
Only X

Reputation: 37

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

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?

Upvotes: 1

Views: 387

Answers (2)

Akash Sharma
Akash Sharma

Reputation: 757

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.

Upvotes: 0

DWSR
DWSR

Reputation: 631

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.

Upvotes: 3

Related Questions