<p>I have an ignite cluster running on <strong>Google Kubernetes Engine</strong>.</p>

<p><code>
sudo kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
ignite-cluster-bbb4f56c4-nrftv   1/1       Running   0          6d
ignite-cluster-bbb4f56c4-skvf6   1/1       Running   0          6d
</code></p>

<p>Now I am trying to connect use <code>igniteRDD</code> on <code>spark</code> using <a href="https://github.com/apache/ignite/blob/master/examples/src/main/scala/org/apache/ignite/scalar/examples/spark/ScalarSharedRDDExample.scala" rel="nofollow noreferrer">this</a> <code>scala</code> code.</p>

<p>Here is my configuration file which I use to detect ignite pods on GKE cluster.</p>

<pre><code>import org.apache.ignite.configuration.IgniteConfiguration
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi
import org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder

object igniteConf {

  def ignite_configuration: IgniteConfiguration = {
    val spi = new TcpDiscoverySpi
    val ipFinder = new TcpDiscoveryKubernetesIpFinder
    ipFinder.setMasterUrl("https://35.192.214.68")
    ipFinder.setServiceName("ignite")
    spi.setIpFinder(ipFinder)
    val cfg = new IgniteConfiguration
    cfg.setDiscoverySpi(spi)
    cfg
  }

}
</code></pre>

<p>and in the main file I use it like this </p>

<pre><code>val igniteContext = new IgniteContext(sparkContext, () =&gt; igniteConf.ignite_configuration, true)
</code></pre>

<p>Now I create a jar and after creating a docker image push to <strong>Google Container Registry</strong>.</p>

<p>Command to run the jar.</p>

<pre><code>sudo bin/spark-submit --master k8s://https://35.192.214.68 --deploy-mode cluster --name sparkIgnite --class org.blk.igniteSparkResearch.ScalarSharedRDDExample --conf spark.executor.instances=3 --conf spark.app.name=sharedSparkIgnite --conf spark.kubernetes.authenticate.driver.serviceAccountName=ignite --conf spark.kubernetes.container.image=us.gcr.io/nlp-research-198620/ignite-spark:v2 local:///opt/spark/jars/igniteSpark-1.0-SNAPSHOT-jar-with-dependencies.jar
</code></pre>

<p>The above command creates 1 driver and 3 executors. Logs of any executors shows that it can't connect to ignite-cluster on kubernetes.</p>

<pre><code>class org.apache.ignite.spi.IgniteSpiException: Failed to retrieve Ignite pods IP addresses

Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://35.192.214.68/api/v1/namespaces/default/endpoints/ignite
</code></pre>

<p>Can anybody let me know where I might be going.</p>

<p>Thanks in advance.</p>

wadhwasahil
<p>This is a known issue. It's permission-related.</p>

<p>Here is a JIRA ticket: <a href="https://issues.apache.org/jira/browse/IGNITE-8081" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/IGNITE-8081</a></p>

<p>You can find a working configuration in a comment.</p>
