Skip to main content

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

  1. Create an S3 bucket for event logs. Set storage.provider: aws, storage.bucket to its name and storage.region to its region.
  2. If you do not have one, create a cloud account for your AWS account. Set storage.cloudAccountName to its name.
  3. Create an AWS IAM policy scoped to the bucket (replace YOUR_BUCKET_NAME), then set storage.policyName to the policy name:
  1. Optionally change storage.prefix, the folder inside the bucket where event logs are written.
The bucket must exist before you enable the History Server. If it is missing or unreachable, the History Server crash-loops with UnknownStoreException or NoSuchBucket in its log.

Installation

A default install needs no --set values:
Or follow the instructions for your preferred method:

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

One image runs every tier.

Master

The master is always a single replica. 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

Used only when 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

Each key: value pair is appended to the rendered spark-defaults.conf, for any Spark setting the template does not expose directly.

Access

With workload-list, the list must include the cluster’s own workloads. The master, workers and Connect server talk to each other over the GVC network, so leaving any of them out breaks the cluster. same-gvc avoids this.
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:
To verify an install, forward the master Web UI to your machine and open 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 with spark.driver.host; without it, executors cannot connect back and the application keeps relaunching executors.
A successful run prints 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

With connect.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:
Match the client’s PySpark version to the server’s Spark version (4.0).

Reaching a Private UI

With publicAccess.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:
Then open 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 with workers.replicas and a Helm upgrade; each worker registers with the master and offers workers.cores and workers.memory to executors:
The master is a single replica with no high availability in this version. It keeps no data, so losing it costs downtime, not data. Completed-application history survives in the bucket. Switching 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

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

Important Notes

  • Nothing is authenticated. Keep publicAccess.enabled: false and use cpln port-forward; turning it on puts the Master and History UIs on the public internet with no login.
  • Every driver must set spark.driver.host to its own IP, or its executors cannot connect back.
  • Create the bucket before enabling the History Server, or it crash-loops.
  • Switching storage.provider needs a fresh install, not a Helm upgrade.
  • With internalAccess.type: workload-list, include the cluster’s own workloads in the list.
  • Keep workers.memory below workers.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