Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add yaml files for external service and namespace and modify README #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,19 @@ The BDE Spark images can also be used in a Kubernetes enviroment.

To deploy a simple Spark standalone cluster issue

`kubectl apply -f https://raw.githubusercontent.com/big-data-europe/docker-spark/master/k8s-spark-cluster.yaml`
`kubectl apply -f k8s/namespace-spark-cluster.yaml`

This will setup a Spark standalone cluster with one master and a worker on every available node using the default namespace and resources. The master is reachable in the same namespace at `spark://spark-master:7077`.
This will create a namespace *spark-cluster*

`kubectl apply -f k8s/k8s-spark-cluster.yaml -n spark-cluster`

This will setup a Spark standalone cluster with one master and a worker on every available node using the namespace *spark-cluster*. The master is reachable in the same namespace at `spark://spark-master:7077`.
It will also setup a headless service so spark clients can be reachable from the workers using hostname `spark-client`.

`kubectl apply -f k8s/spark-master-external-service.yaml -n spark-cluster`

Finally, an external service will be created in the namespace *spark-cluster* to expose Spark Web UI using LoadBalancer.

Then to use `spark-shell` issue

`kubectl run spark-base --rm -it --labels="app=spark-client" --image bde2020/spark-base:3.3.0-hadoop3.3 -- bash ./spark/bin/spark-shell --master spark://spark-master:7077 --conf spark.driver.host=spark-client`
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions k8s/namespace-spark-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: "spark-cluster"
labels:
name: "spark-cluster"
14 changes: 14 additions & 0 deletions k8s/spark-master-external-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: spark-master-external-service
labels:
app: spark-master
spec:
# Create an externally reachable load balancer.
type: LoadBalancer
ports:
- port: 8080
name: web-ui
selector:
app: spark-master