This Helm chart deploys Apache Livy and Apache Spark on a local Kubernetes cluster, such as Docker Desktop with Kubernetes enabled. It is intended for development and debugging without relying on cloud services.
JIRA: LIVY-979
clusterHost in values.yaml (default my-cluster.example.com):127.0.0.1 my-cluster.example.com
The chart defaults match a Livy build produced with:
mvn -Pthriftserver -Pscala-2.12 -Pspark3 package
| Setting | Default |
|---|---|
| Livy | 1.0.0-SNAPSHOT |
| Spark | 3.5.6 |
| Scala | 2.12 |
Update values.yaml if you build with different profiles or versions. Image tags default from sparkVersion when left empty (v3.5.6 for Spark, spark3.5.6 for Livy).
Chart dependencies are declared in Chart.yaml and resolved at deploy time. Do not commit the downloaded archives under charts/:
cd dev/helmchart helm dependency build
When ingress is enabled, the chart installs cert-manager and ingress-nginx as subcharts. On a fresh cluster, cert-manager CRDs are installed via cert-manager.installCRDs=true (the chart default).
References:
cd dev/helmchart helm dependency build kubectl create namespace livy-dev helm -n livy-dev install livycluster . \ --set image.livy.repository=<your_repository>/livy \ --set image.spark.repository=<your_repository>/spark-py \ --set ingress-nginx.controller.extraArgs.default-ssl-certificate=livy-dev/ingress-default-tls
Set ingress-nginx.controller.extraArgs.default-ssl-certificate to <release-namespace>/<tls-secret-name> (defaults: livy-dev/ingress-default-tls).
Remote debugging is enabled by default (debug.enabled: true) on port 9010, matching the pattern used in dev/docker/livy-dev-cluster/conf/livy/livy-env.sh. Disable it for non-debug deployments:
helm upgrade livycluster . -n livy-dev --set debug.enabled=false
Livy can link Spark driver and executor logs to Grafana when Loki is available. The chart maps the following values.yaml keys to livy.conf:
| values.yaml | livy.conf |
|---|---|
grafana.loki.enabled | livy.server.kubernetes.grafana.loki.enabled |
grafana.url | livy.server.kubernetes.grafana.url |
grafana.lokiDatasource | livy.server.kubernetes.grafana.loki.datasource |
grafana.timeRange | livy.server.kubernetes.grafana.timeRange |
To enable Loki integration:
loki in Grafana (or override grafana.lokiDatasource).helm upgrade livycluster . -n livy-dev \ --set grafana.loki.enabled=true \ --set grafana.url=http://grafana.livy-dev.svc.cluster.local:3000
When enabled, Livy adds log links in the session UI that open Grafana Explore for the matching Spark application labels.
kubectl -n livy-dev get pods -w
Create an interactive session:
curl -k -X POST -H "Content-Type: application/json" \ --data '{"kind": "spark"}' \ https://my-cluster.example.com/livy/sessions | jq
Run a statement:
curl -k -X POST \ -H "Content-Type: application/json" \ -d '{"kind": "spark", "code": "sc.parallelize(1 to 10).count()"}' \ https://my-cluster.example.com/livy/sessions/0/statements | jq
Submit a batch job:
curl -s -k -H "Content-Type: application/json" -X POST \ -d '{ "name": "testbatch1", "className": "org.apache.spark.examples.SparkPi", "numExecutors": 2, "file": "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.6.jar", "args": ["10000"] }' "https://my-cluster.example.com/livy/batches" | jq
Update the examples JAR path if you change scalaBinaryVersion or sparkVersion in values.yaml (pattern: spark-examples_<scala>-<spark>.jar).
Run the chart checks locally:
dev/helmchart/test/validate.sh