This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Description
@foxish
I was running our Spark-on-K8s code against a Google Container Engine (GKE) cluster. In our code, the driver pod opens up a NodePort so that the client can submit requests to the port. In GKE, the firewall is set up to block any access to cluster nodes. So the client won't be able to access driver NodePort. From https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
When using a Service with spec.type: LoadBalancer, the firewall will be opened automatically. When using spec.type: NodePort, however, the firewall is not opened by default.
I ended up manually opening all NodePort range. (Since NodePort is randomly assigned per job, it is not possible/practical to just open up a single port):
$ gcloud compute firewall-rules create k8snodeport --allow tcp:30000-32767
This allowed me to submit Spark jobs from my Macbook.
However, Google has Cloud Shell that one could use for job submission. I wasn't able to get the Cloud Shell to work even after opening up the NodePort range. Maybe there is a separate firewall on the Cloud Shell side as well.
Maybe we should at least document these caveats so that people would know.