Overview
Apache Spark is a distributed engine for batch ETL, large-scale data transformation, and SQL and DataFrame analytics. This template runs a Spark standalone cluster: a master (cluster manager and Web UI), a worker tier you scale with one value, an optional Spark Connect gRPC server for remote clients, and an optional History Server that lists completed applications by reading their event logs back from an S3 or GCS bucket.This template deploys into an existing GVC that you already have; it does not create or manage one. Every workload runs in each location of that GVC, and the template was validated in a single-location GVC, so install it into one.
What Gets Created
No volume set is created. Worker scratch space is ephemeral, and the only durable store is the bucket the History Server reads.
Prerequisites
None for a default install. The master and a single worker start with no external dependencies. The History Server (historyServer.enabled: true) needs an object-storage bucket and a Control Plane cloud account before you enable it. Access is keyless: the workload identity federates with the cloud account, so no access keys are created or stored.
1
Bucket and cloud account for the History Server
- AWS S3
- GCS
- Create an S3 bucket for event logs. Set
storage.provider: aws,storage.bucketto its name andstorage.regionto its region. - If you do not have one, create a cloud account for your AWS account. Set
storage.cloudAccountNameto its name. - Create an AWS IAM policy scoped to the bucket (replace
YOUR_BUCKET_NAME), then setstorage.policyNameto the policy name:
- Optionally change
storage.prefix, the folder inside the bucket where event logs are written.
Installation
A default install needs no--set values:
UI
Browse, install, and manage templates visually
CLI
Manage templates from your terminal
Terraform
Declare templates in your Terraform configurations
Pulumi
Declare templates in your Pulumi programs
Configuration
Image
Master
maxCpu and maxMemory are the container limits; minCpu and minMemory are the reservation. The same four keys appear on every tier.
Workers
workers.memory is what each worker offers to executors, not the container limit. Keep it below workers.maxMemory, which also has to cover the worker process itself.
Spark Connect
connect.enabled: true starts a Spark Connect server on gRPC port 15002, so thin clients can run DataFrame and SQL work without an exec shell. See Using Spark Connect.
History Server
historyServer.enabled: true starts the History Server on 18080 and turns on event logging for applications that use the cluster’s spark-defaults.conf. It requires the bucket and cloud account from Prerequisites and the storage values below. While it is enabled, every workload downloads the S3 or GCS connector jars from Maven Central at start, which needs outbound internet access.
Object Storage
historyServer.enabled is true. The chart refuses to render when the History Server is on and storage.bucket or storage.cloudAccountName is empty, or storage.provider is not aws or gcp.
Extra Spark Configuration
key: value pair is appended to the rendered spark-defaults.conf, for any Spark setting the template does not expose directly.
Access
publicAccess.enabled: true puts the Master and History Server Web UIs on public *.cpln.app endpoints. Spark’s Web UIs have no authentication, so anyone with the URL can see the cluster and its applications. Workers and the Connect server are never exposed publicly. A firewall change can take a few minutes to take effect.
Connecting
Spark’s Web UIs and cluster port are unauthenticated, so there are no credentials to retrieve.
Read a public endpoint with:
http://localhost:8080 — the worker should be listed as ALIVE:
Submitting Jobs
Submit from the master container or from any client workload in the GVC. The driver must advertise its own IP withspark.driver.host; without it, executors cannot connect back and the application keeps relaunching executors.
Pi is roughly 3.14. A job submitted from the template’s own containers picks up the mounted spark-defaults.conf, so with the History Server enabled its event log lands in your bucket. A driver running elsewhere has to set its own event-log settings to appear in the History Server.
With publicAccess.enabled: true, add --conf spark.ui.reverseProxyUrl= followed by the master’s public URL to your submit command, so the links in the application’s own UI resolve in a browser.
Using Spark Connect
Withconnect.enabled: true, a PySpark client in any workload of the GVC connects with the sc:// address. The apache/spark image ships only the server side, so install the client package — it pulls in pandas, pyarrow and grpcio — in the client environment:
Reaching a Private UI
WithpublicAccess.enabled: false (the default), open any Web UI through cpln port-forward, which works with the firewall fully closed. The History Server is reached the same way as the master:
http://localhost:18080. An empty application list is normal until the first job with event logging completes.
Operations
Scaling and Availability
Change the worker count withworkers.replicas and a Helm upgrade; each worker registers with the master and offers workers.cores and workers.memory to executors:
storage.provider between aws and gcp needs a fresh install, not an upgrade — the identity keeps its old cloud binding when it is updated. Uninstall, then install again with the new provider:
Troubleshooting
A job never finishes and keeps relaunching executors
A job never finishes and keeps relaunching executors
Symptom: the application appears in the master UI, but executors are repeatedly launched and lost and the job makes no progress.Cause: the driver advertises an address the executors cannot reach, so they never connect back to it.Fix: set
spark.driver.host to the driver’s own IP on submit, as in Submitting Jobs. This looks like a resource problem but is a networking one.The History Server crash-loops with NoSuchBucket
The History Server crash-loops with NoSuchBucket
Symptom:
RELEASE_NAME-spark-history never becomes ready, and its log shows UnknownStoreException or NoSuchBucket.Cause: the bucket in storage.bucket does not exist, or the identity cannot reach it.Fix: create the bucket and check the cloud account and IAM policy or role from Prerequisites. Read the log with:A Spark Connect client fails to import pandas or pyarrow
A Spark Connect client fails to import pandas or pyarrow
Symptom:
SparkSession.builder.remote(...) raises an import error for pandas, pyarrow or grpcio.Cause: a Spark Connect client needs its own client-side dependencies; the server image does not provide them to remote clients.Fix: install pyspark[connect] in the client environment.Workers stop registering after switching to workload-list
Workers stop registering after switching to workload-list
Symptom: after setting
internalAccess.type: workload-list, the cluster stops working — workers are missing from the master UI or jobs never get executors.Cause: the cluster’s own workloads are not in internalAccess.workloads, so the firewall blocks them from each other.Fix: add the master, worker and (if enabled) Connect workloads to the list, or go back to same-gvc.Links in a public application UI point to a cpln.local address
Links in a public application UI point to a cpln.local address
Symptom: with
publicAccess.enabled: true, a link inside a running application’s UI opens a *.cpln.local address that does not resolve in your browser.Cause: the application was submitted without the master’s public URL, so it builds its links from the internal hostname.Fix: add --conf spark.ui.reverseProxyUrl= with the master’s public URL when you submit the job.Important Notes
- Nothing is authenticated. Keep
publicAccess.enabled: falseand usecpln port-forward; turning it on puts the Master and History UIs on the public internet with no login. - Every driver must set
spark.driver.hostto its own IP, or its executors cannot connect back. - Create the bucket before enabling the History Server, or it crash-loops.
- Switching
storage.providerneeds a fresh install, not a Helm upgrade. - With
internalAccess.type: workload-list, include the cluster’s own workloads in the list. - Keep
workers.memorybelowworkers.maxMemory— it is Spark’s offer to executors, not the container limit. - Install into a single-location GVC — every workload runs in each location the GVC has.
External References
Spark Standalone Mode
How the standalone master and workers operate
Monitoring and History Server
Event logs, the History Server, and metrics
Spark Connect
Thin and remote client access over gRPC
Submitting Applications
spark-submit options and application packaging
Spark Template
View the source files, default values, and chart definition