@Singleton @Requires(env="k8s") @Requires(beans={KubernetesClient.class,KubernetesConfiguration.KubernetesDiscoveryConfiguration.class}) @Requires(property="kubernetes.client.discovery.enabled",notEquals="false") @Replaces(bean=io.micronaut.discovery.kubernetes.KubernetesDiscoveryClient.class) public class KubernetesDiscoveryClient extends java.lang.Object implements io.micronaut.discovery.DiscoveryClient
DiscoveryClient
implementation for Kubernetes using the API.Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
KubernetesDiscoveryClient(KubernetesClient client,
KubernetesConfiguration configuration,
KubernetesConfiguration.KubernetesDiscoveryConfiguration discoveryConfiguration,
KubernetesServiceInstanceList instanceList) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getDescription() |
org.reactivestreams.Publisher<java.util.List<io.micronaut.discovery.ServiceInstance>> |
getInstances(java.lang.String serviceId) |
org.reactivestreams.Publisher<java.util.List<java.lang.String>> |
getServiceIds() |
public KubernetesDiscoveryClient(KubernetesClient client, KubernetesConfiguration configuration, KubernetesConfiguration.KubernetesDiscoveryConfiguration discoveryConfiguration, KubernetesServiceInstanceList instanceList)
client
- An HTTP Client to query the Kubernetes API.configuration
- The configuration propertiesdiscoveryConfiguration
- The discovery configuration propertiesinstanceList
- The KubernetesServiceInstanceList
public org.reactivestreams.Publisher<java.util.List<io.micronaut.discovery.ServiceInstance>> getInstances(java.lang.String serviceId)
getInstances
in interface io.micronaut.discovery.DiscoveryClient
public org.reactivestreams.Publisher<java.util.List<java.lang.String>> getServiceIds()
getServiceIds
in interface io.micronaut.discovery.DiscoveryClient
public java.lang.String getDescription()
getDescription
in interface io.micronaut.core.naming.Described
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException