@Singleton @Requires(env="k8s") public class KubernetesDiscoveryClient extends Object implements DiscoveryClient
DiscoveryClient
implementation for Kubernetes. Kubernetes uses environment variables so no API calls is
required.Constructor and Description |
---|
KubernetesDiscoveryClient()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
getDescription()
A description that describes this object.
|
io.reactivex.Flowable<List<ServiceInstance>> |
getInstances(String serviceId)
Obtain a list of
ServiceInstance for the given service id. |
io.reactivex.Flowable<List<String>> |
getServiceIds() |
protected Map<String,String> |
resolveEnvironment()
Resolves the environment variables.
|
public KubernetesDiscoveryClient()
public io.reactivex.Flowable<List<ServiceInstance>> getInstances(String serviceId)
DiscoveryClient
ServiceInstance
for the given service id.getInstances
in interface DiscoveryClient
serviceId
- The service idPublisher
that emits a list of ServiceInstance
public io.reactivex.Flowable<List<String>> getServiceIds()
getServiceIds
in interface DiscoveryClient
public String getDescription()
Described
getDescription
in interface Described
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException