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

Discuss that GKE firewall should open the NodePort range to use Spark-on-K8s  #245

@kimoonkim

Description

@kimoonkim

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions