A Helm chart and Docker container for deploying Spark History Server (Spark Web UI) to monitor the metrics and performance of your Spark jobs.
This project provides two main components:
Spark History Server provides a web interface that visualizes information about completed Spark applications, including event timelines, stages, and executor metrics.
git clone https://github.com/kubedai/spark-history-server.git
cd spark-history-server
docker build -t $USER/spark-web-ui:latest .
The repository includes a helper script to simplify running the container locally. The script supports the following actions:
sh launch_spark_history_server_locally.sh {start|stop|restart|status|help} [options]
sh launch_spark_history_server_locally.sh start -sb my-bucket -sp spark/history/events
-sb or --S3_BUCKET: S3 bucket name (required for start/restart)-sp or --S3_BUCKET_PREFIX: S3 bucket prefix where event logs are stored (required for start/restart)-r or --AWS_REGION: AWS Region (default: us-east-1)-cn or --CONTAINER_NAME: Container name (default: spark-history-server)-du or --DOCKER_USER: Docker user (default: current user)-ak or --AWS_ACCESS_KEY_ID: AWS access key (optional if exported as env var)-as or --AWS_SECRET_ACCESS_KEY: AWS secret key (optional if exported as env var)-at or --AWS_SESSION_TOKEN: AWS session token (optional if exported as env var)When started, you can access the Spark History Server at http://localhost:18080
If deploying on EKS and using S3 for Spark Event logs, you’ll need to create an IAM Role for Service Accounts:
eksctl create iamserviceaccount \
--cluster=<eks-cluster-name> \
--name=spark-history-server \
--namespace=spark-history-server \
--attach-policy-arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
Add the repository and update:
helm repo add kubedai https://kubedai.github.io/spark-history-server
helm repo update
Install the chart:
helm install spark-history-server kubedai/spark-history-server --namespace spark-history-server
Before deploying, you’ll need to update the values.yaml file with:
Example values:
serviceAccount:
create: false
annotations:
eks.amazonaws.com/role-arn: "<ENTER_IRSA_IAM_ROLE_ARN_HERE>"
name: "spark-history-server"
sparkHistoryOpts: "-Dspark.history.fs.logDirectory=s3a://<ENTER_S3_BUCKET_NAME>/<PREFIX_FOR_SPARK_EVENT_LOGS>/"
kubectl port-forward services/spark-history-server 18085:80 -n spark-history-server
Then open a browser and navigate to http://localhost:18085/
If you have configured an ingress, you can access the UI through the ingress URL.
Upgrade the chart:
helm upgrade spark-history-server --namespace spark-history-server
Uninstall the chart:
helm uninstall spark-history-server --namespace spark-history-server
Give us a star ⭐️ - If you are using Spark History Server, we would love a star ❤️
This project is licensed under the Apache License 2.0.