In case of using eureka (+ Spring Boot) you can reach special endpoint where list of currently registered instances can be found. E.g.:
Does Kubernetes service disco