To access ignite from outside of kubernetes, you need to enable hostNetwork in the kubernetes cluster for your ignite server pods (this is not enabled with default permissions as it goes against many of the core principals of kubernetes). This will allow the ignite server to attach directly the host network interface of the server its running on rather than the internal networking setup by kubernetes to hide the container from the outside world. This lets the pod expose/connect itself directly to the external network. The kubernetes discovery spi can then be used by your external clients to connect from outside the cluster into the cluster. Your external clients will need to be able to authenticate to the kubernetes API to read the service information from the kubernetes service in the same way the internal pods do, except now there is an address in the list that the external pods can actually connect to. You don’t get this authentication for free as you would inside a kubernetes pod, but it works fine with manual configuration.
https://apacheignite-mix.readme.io/docs/kubernetes-discovery > On Mar 15, 2018, at 4:33 PM, Ryan Samo <[email protected]> wrote: > > Hey guys and gals! > I have created a development environment for Ignite 2.3 Native Persistence > on Kubernetes 1.9.3 and have it up and running successfully. I then > attempted to activate one of my clusters via a Java client call and > discovered that the TcpDiscoveryKubernetesIpFinder doesn't support the > "addresses" property by receiving the following error: > > *Caused by: org.springframework.beans.NotWritablePropertyException: Invalid > property 'addresses' of bean class > [org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder]: > Bean property 'addresses' is not writable or has an invalid setter method. > Does the parameter type of the setter match the return type of the getter?* > > It turns out that in the documentation for the > TcpDiscoveryKubernetesIpFinder class, there is a statement that says: > > *"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."* > > I get that in most cases, it's best to run all of the components from within > Kubernetes for security purposes, but our use case is to create an Ignite > cluster and then hit them from external clients. In digging through the > TcpDiscoveryKubernetesIpFinder code, I see that it inherits > TcpDiscoveryIpFinder which has the methods we need to specify Ignite server > addresses. With that being said, my questions are... > > 1.) Is there any development going on around the > TcpDiscoveryKubernetesIpFinder class to possibly add external client > connections outside of Kubernetes? > > 2.) If I decided to build my own version of the > TcpDiscoveryKubernetesIpFinder class that allows for external connections, > would that be broken in upcoming releases? > > Thanks! > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/
