Package org.apache.ignite.client
Class ThinClientKubernetesAddressFinder
- java.lang.Object
-
- org.apache.ignite.client.ThinClientKubernetesAddressFinder
-
- All Implemented Interfaces:
ClientAddressFinder
public class ThinClientKubernetesAddressFinder extends Object implements ClientAddressFinder
Address finder for automatic lookup of Ignite server nodes running in Kubernetes environment. All Ignite nodes have to be deployed as Kubernetes pods in order to be found. Applications and Ignite nodes running outside of Kubernetes will not be able to reach the containerized counterparts.The implementation is based on a distinct Kubernetes service. The name of the service must be set with
KubernetesConnectionConfiguration
. As for Ignite pods, it's recommended to label them in such a way that the service will target only server nodes.The address finder, in its turn, will call this service to retrieve Ignite pods IP addresses. The port is set with value passed to constructor. Make sure that all Ignite pods occupy a similar ClientConnector port, otherwise they will not be able to connect each other using this address finder.
-
-
Constructor Summary
Constructors Constructor Description ThinClientKubernetesAddressFinder(KubernetesConnectionConfiguration cfg)
ThinClientKubernetesAddressFinder(KubernetesConnectionConfiguration cfg, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
getAddresses()
Get addresses of Ignite server nodes within a cluster.
-
-
-
Constructor Detail
-
ThinClientKubernetesAddressFinder
public ThinClientKubernetesAddressFinder(KubernetesConnectionConfiguration cfg)
- Parameters:
cfg
- Kubernetes connection configuration.
-
ThinClientKubernetesAddressFinder
public ThinClientKubernetesAddressFinder(KubernetesConnectionConfiguration cfg, int port)
- Parameters:
cfg
- Kubernetes connection configuration.port
- Port that Ignite uses to listen client connections.
-
-
Method Detail
-
getAddresses
public String[] getAddresses()
Get addresses of Ignite server nodes within a cluster. An address can be IPv4 address or hostname, with or without port. If port is not set then Ignite will generate multiple addresses for default port range. SeeClientConnectorConfiguration.DFLT_PORT
,ClientConnectorConfiguration.DFLT_PORT_RANGE
.- Specified by:
getAddresses
in interfaceClientAddressFinder
- Returns:
- Addresses of Ignite server nodes within a cluster.
-
-