Failed to retrieve Ignite pods IP addresses when running spark client

6/19/2018

I have an ignite cluster running on Google Kubernetes Engine.

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

Now I am trying to connect use igniteRDD on spark using this scala code.

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

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
  }

}

and in the main file I use it like this

val igniteContext = new IgniteContext(sparkContext, () => igniteConf.ignite_configuration, true)

Now I create a jar and after creating a docker image push to Google Container Registry.

Command to run the jar.

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

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

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

Can anybody let me know where I might be going.

Thanks in advance.

-- wadhwasahil
apache-spark
ignite
kubernetes

1 Answer

6/19/2018

This is a known issue. It's permission-related.

Here is a JIRA ticket: https://issues.apache.org/jira/browse/IGNITE-8081

You can find a working configuration in a comment.

-- Denis
Source: StackOverflow