Search code examples
c#kubernetesignite

Apache Ignite C# Client Connection configuration for kubernetes


We are following the below article to establish C# client connection to the Ignite Cluster, both of them deployed in the Kubernetes.

https://ignite.apache.org/docs/latest/installation/kubernetes/amazon-eks-deployment#creating-service

We do not find the equivalent C# class/method to perform the connection configuration in the C# client application.

enter image description here

Please help us to find alternate methods to do the connection configuration for Kubernetes.


Solution

  • This API is not yet available for .NET, the relevant ticket is in progress and most likely will be included into the next release.

    For now, you can list a set of server IPs for your thin clients explicitly. And for your server and thick client nodes it's fine to rely on spring.xml configuration. More details here.

    Example:

     var cfg = new IgniteConfiguration
     {
        ...
        SpringConfigUrl = "/path/to/spring.xml"
      };
    

    And your spring configuration:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd">
    
        <bean class="org.apache.ignite.configuration.IgniteConfiguration">
    
            <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
            <property name="discoverySpi">
                <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                    <property name="ipFinder">
                        <!--
                            Enables Kubernetes IP finder and setting custom namespace and service names.
                        -->
                        <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
                            <property name="namespace" value="ignite"/>
                        </bean>
                    </property>
                </bean>
            </property>
        </bean>
    </beans>