Class TcpDiscoveryKubernetesIpFinder
- java.lang.Object
- 
- org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter
- 
- org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
 
 
- 
- All Implemented Interfaces:
- TcpDiscoveryIpFinder
 
 public class TcpDiscoveryKubernetesIpFinder extends TcpDiscoveryIpFinderAdapter IP finder for automatic lookup of Ignite nodes running in Kubernetes environment. All Ignite nodes have to deployed as Kubernetes pods in order to be discovered. An application that uses Ignite client nodes as a gateway to the cluster is required to be containerized as well. 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 way that the service will target only nodes that are able to be discovered, i.e. server and thick client nodes.The IP finder, in its turn, will call this service to retrieve Ignite pods IP addresses. The port will be either the one that is set with TcpDiscoverySpi.setLocalPort(int)orTcpDiscoverySpi.DFLT_PORT. Make sure that all Ignite pods occupy a similar discovery port, otherwise they will not be able to discover each other using this IP finder.Both registerAddresses(Collection)andunregisterAddresses(Collection)have no effect.Note, this IP finder is only workable when it used in Kubernetes environment. Choose another implementation of TcpDiscoveryIpFinderfor local or home network tests.
- 
- 
Field Summary- 
Fields inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapterignite
 
- 
 - 
Constructor SummaryConstructors Constructor Description TcpDiscoveryKubernetesIpFinder()Creates an instance of Kubernetes IP finder.TcpDiscoveryKubernetesIpFinder(KubernetesConnectionConfiguration cfg)Creates an instance of Kubernetes IP finder.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Collection<InetSocketAddress>getRegisteredAddresses()Gets all addresses registered in this finder.voidincludeNotReadyAddresses(boolean includeNotReadyAddresses)Deprecated.set parameters withKubernetesConnectionConfigurationinstead.voidregisterAddresses(Collection<InetSocketAddress> addrs)Registers new addresses.voidsetAccountToken(String accountToken)Deprecated.set parameters withKubernetesConnectionConfigurationinstead.voidsetMasterUrl(String master)Deprecated.set parameters withKubernetesConnectionConfigurationinstead.voidsetNamespace(String namespace)Deprecated.set parameters withKubernetesConnectionConfigurationinstead.voidsetServiceName(String service)Deprecated.set parameters withKubernetesConnectionConfigurationinstead.voidunregisterAddresses(Collection<InetSocketAddress> addrs)Unregisters provided addresses.- 
Methods inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapterclose, discoveryClientMode, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, setShared, spiContext, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
TcpDiscoveryKubernetesIpFinderpublic TcpDiscoveryKubernetesIpFinder() Creates an instance of Kubernetes IP finder.
 - 
TcpDiscoveryKubernetesIpFinderpublic TcpDiscoveryKubernetesIpFinder(KubernetesConnectionConfiguration cfg) Creates an instance of Kubernetes IP finder.- Parameters:
- cfg- Kubernetes IP finder configuration.
 
 
- 
 - 
Method Detail- 
getRegisteredAddressespublic Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException Gets all addresses registered in this finder.- Returns:
- All known addresses, potentially empty, but never null.
- Throws:
- IgniteSpiException- In case of error.
 
 - 
registerAddressespublic void registerAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException Registers new addresses.Implementation should accept duplicates quietly, but should not register address if it is already registered. - Parameters:
- addrs- Addresses to register. Not- nulland not empty.
- Throws:
- IgniteSpiException- In case of error.
 
 - 
unregisterAddressespublic void unregisterAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException Unregisters provided addresses.Implementation should accept addresses that are currently not registered quietly (just no-op). - Parameters:
- addrs- Addresses to unregister. Not- nulland not empty.
- Throws:
- IgniteSpiException- In case of error.
 
 - 
setServiceName@Deprecated public void setServiceName(String service) Deprecated.set parameters withKubernetesConnectionConfigurationinstead.- Parameters:
- service- Kubernetes service name.
 
 - 
setNamespace@Deprecated public void setNamespace(String namespace) Deprecated.set parameters withKubernetesConnectionConfigurationinstead.- Parameters:
- namespace- Namespace of the Kubernetes service.
 
 - 
setMasterUrl@Deprecated public void setMasterUrl(String master) Deprecated.set parameters withKubernetesConnectionConfigurationinstead.- Parameters:
- master- Host name of the Kubernetes API server.
 
 - 
setAccountToken@Deprecated public void setAccountToken(String accountToken) Deprecated.set parameters withKubernetesConnectionConfigurationinstead.- Parameters:
- accountToken- Path to the service token file.
 
 - 
includeNotReadyAddresses@Deprecated public void includeNotReadyAddresses(boolean includeNotReadyAddresses) Deprecated.set parameters withKubernetesConnectionConfigurationinstead.- Parameters:
- includeNotReadyAddresses- Whether addresses of not-ready pods should be included.
 
 
- 
 
-