Skip to main content
Version 3.0

Distributed data processing
with Spark.

Five common scenarios, from the first installation to application history. Each one covers: what the chart already provides, what changes in the cluster, the values file commented line by line, and a step-by-step with verification.

ChartVersion3.0.3TypeapplicationAppVersion4.0.2
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+
Feature SupportS3supportedIngresssupportedGateway APIsupported

The tdp-spark chart starts Apache Spark in standalone mode, with Spark's own cluster manager: a master, which receives applications, and workers, where the executors run, the processes that carry out each application's work. The S3A, Iceberg and Delta Lake jars already come in the image. Sizing, history, access and integrations are your decisions, and each scenario below addresses one of them. For the architecture, see Apache Spark - Concepts.

Your environment

If you fill in your environment details here, this page's examples and commands use the values you provided. The namespace, the release name and the values file are your choices, not the chart's.

Scenarios​

Install with chart defaults, open the master interface and submit the example from the image.

This tab installs Spark with the chart defaults, without a values file, opens the master interface from your machine and submits the example included in the image. What starts is a master, which receives applications, and workers, where applications run.

Each Spark application has a driver, the process that runs the main program and splits the work into tasks, and executors, the processes that carry out those tasks on the workers.

You want to see Spark working before deciding about resources, storage or access. Everything shown here is what the chart provides by itself. The other scenarios start from this state.

Topology

One master and the workers from spark.worker.replicaCount, in standalone mode. HPA disabled (spark.worker.autoscaling.enabled).

Resources

Requests and limits in spark.master.resources and spark.worker.resources. Executor and driver sizes in customSparkConfig.properties (values in All parameters).

Access

Internal master Service (ClusterIP), with the web interface on the spark.service.ports.http port and application submission on spark.service.ports.cluster. No Ingress.

Storage

fs.defaultFS points to the warehouse bucket through S3A, without an endpoint or keys: S3 access is enabled in scenario 5.

History

History Server and event logs disabled. Scenario 3 enables both.

Table formats

S3A jars on the driver and executor classpath. Iceberg and Delta Lake disabled.

What starts in the namespace with chart defaults

namespace <NAMESPACE>port-forwardUsersport-forwardMaster Service<SPARK_MASTER_SERVICE>Masterreceives applicationsWorker ×2fixed countHistory Serverdisabledcore-site.xmlspark-defaults.confJars in the image
  1. Users. Without external exposure, each person opens a tunnel from their own machine to the master Service with kubectl port-forward. Chart default: no external exposure (port-forward).
  2. Master Service. The master's internal address in the cluster: the web interface on the spark.service.ports.http port, and application submission on spark.service.ports.cluster. The name is <RELEASE_NAME>-spark-master-svc, or <RELEASE_NAME>-master-svc when the release name already contains spark. Chart default: ClusterIP. (spark.service.ports.http · spark.service.ports.cluster)
  3. Master. Receives submitted applications and distributes their executors among workers. Chart default: requests and limits in spark.master.resources. (spark.master.resources)
  4. Workers. Run application executors. The count is fixed, from spark.worker.replicaCount. An executor is only scheduled on a worker with the memory and cores it requests. Chart default: count in spark.worker.replicaCount · HPA disabled · requests and limits in spark.worker.resources. (spark.worker.replicaCount · spark.worker.resources)
  5. Spark History Server. The chart's own History Server, disabled by default. With it disabled, event logs are also disabled. Chart default: disabled. (spark.historyServer.enabled)
  6. core-site.xml. Hadoop properties, such as S3A settings, generated from hadoopConfig and mounted in the master and workers. Chart default: fs.defaultFS in the warehouse bucket, no endpoint or keys. (tdp-spark.hadoopConfig)
  7. spark-defaults.conf. Spark properties generated from customSparkConfig.properties, plus lines the chart adds for the classpath, integrations and History Server. Chart default: event logs disabled; executor and driver sizes. (tdp-spark.customSparkConfig.properties)
  8. Image jars. The S3A, Iceberg and Delta Lake jars are already in the image. The chart always adds S3A jars to the driver and executor classpath, and adds Iceberg and Delta Lake jars when you enable them. Chart default: S3A on the classpath; Iceberg and Delta Lake disabled. (tdp-spark.bundledJars)
What starts in the namespace with chart defaults. Click an element to see what it is and its corresponding default.

Check the TDP license

The chart requires a valid TDP license installed in the cluster.

Terminal input
kubectl get platformlicenses -A

Success criteria

The license appears in the list. If it does not, install or renew it before continuing (Licensing Configuration).

Create the registry pull Secret

The Spark image comes from the Tecnisys registry, which requires login.

The tdp-registry Secret must exist in the release namespace before installation. If the namespace does not exist yet, create it first with kubectl create namespace <NAMESPACE>.

Terminal input
kubectl -n <NAMESPACE> create secret docker-registry tdp-registry \
--docker-server=registry.tecnisys.com.br \
--docker-username=<REGISTRY_USERNAME> --docker-password=<REGISTRY_CLI_SECRET>

Success criteria

Terminal input
kubectl -n <NAMESPACE> get secret tdp-registry

The Secret appears in the namespace. Without it, pods remain in ImagePullBackOff. Where to obtain the registry username and password: Prerequisites.

Install with defaults

Without a values file, the chart starts exactly as in the figure above.

Terminal input
helm install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-spark \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace

--version installs the chart version for this documentation. Without it, Helm installs the latest version published in the registry.

On OpenShift, the command is the same: the restricted-v2 SCC assigns pod UIDs and GIDs according to global.compatibility.openshift.adaptSecurityContext (details in Security - Spark).

Success criteria

Terminal input
kubectl -n <NAMESPACE> get pods -l app.kubernetes.io/name=spark

The master and workers reach Running.

If a pod does not start

Namespace events, in chronological order, show the reason:

Terminal input
kubectl -n <NAMESPACE> get events --sort-by=.lastTimestamp

Then look up the message in When something goes wrong.

Open the master interface from your machine

Without external exposure, kubectl opens a tunnel from your machine to the master Service.

The master Service is named <RELEASE_NAME>-spark-master-svc, or <RELEASE_NAME>-master-svc when the release name already contains spark. With release spark, it is spark-master-svc, and the master pod is spark-master-0. The release's Services appear with:

Terminal input
kubectl -n <NAMESPACE> get svc -l app.kubernetes.io/instance=<RELEASE_NAME>
Terminal input
kubectl -n <NAMESPACE> port-forward svc/<SPARK_MASTER_SERVICE> 8080:80

Success criteria

The master interface opens at http://localhost:8080 and lists workers.

Submit the example from the image

SparkPi, included in the image, runs in the cluster from the master pod.

The master serves through the Service, not localhost. sh -c expands the jar name inside the pod:

Terminal input
kubectl -n <NAMESPACE> exec \
$(kubectl -n <NAMESPACE> get pod -l app.kubernetes.io/component=master -o jsonpath='{.items[0].metadata.name}') \
-- sh -c 'spark-submit --master spark://<SPARK_MASTER_SERVICE>:7077 \
--class org.apache.spark.examples.SparkPi \
/opt/bitnami/spark/examples/jars/spark-examples_*.jar 10'

Success criteria

spark-submit finishes without error and the application appears among completed applications in the master interface.
If the application keeps waiting and never runs

An executor requesting more memory or cores than a worker offers is never scheduled. See the rule in scenario 2.

When something goes wrong​

Troubleshooting

Paste the error message or choose a symptom. The answer includes the cause, what to do and the command.

  1. Installation rejected: license check failed. Cause: The TDP license is missing or invalid in the cluster. What to do: Check the license with the command below. If its status is not VALID, install or renew it (Licensing Configuration) and repeat installation.
  2. Pods in ImagePullBackOff. Cause: The tdp-registry pull Secret is missing from the release namespace: the Spark image comes from the Tecnisys registry, which requires login. What to do: Create the tdp-registry Secret in the release namespace with your registry credentials (scenario 1, First contact).
  3. Application keeps waiting and never receives executors. Cause: The executor requests more memory or cores than a worker offers and is never scheduled. What to do: Reduce spark.executor.memory and spark.executor.cores in your copy of customSparkConfig.properties, or increase spark.worker.resources limits (Sizing scenario).
  4. Driver does not start: event log directory does not exist. Cause: Event logs are enabled in a directory that does not exist. Without History Server, the chart leaves event logs disabled for this very reason. What to do: Enable History Server (History scenario), which creates the directory, or leave spark.eventLog.enabled false in your copy of customSparkConfig.properties.
  5. History Server does not start with event logs in S3. Cause: The spark.historyServer.eventLog.dir directory needs the S3 endpoint and keys in hadoopConfig, and the bucket must exist. What to do: Configure S3 (Integrations - Spark, S3 scenario) and create the bucket before enabling History Server.
  6. Master, workers and History Server stuck on a single node. Cause: With event logs on a ReadWriteOnce PVC, every pod using the volume is scheduled on the same node. What to do: Use a StorageClass with ReadWriteMany when these pods can run on different nodes.
  7. HPA does not scale workers. Cause: Metrics Server is missing or worker requests are not configured. What to do: Install Metrics Server and keep spark.worker.resources.requests configured.
  8. Interface links lead to internal addresses or return to the home page. Cause: The public address was not supplied to the Spark reverse proxy. What to do: Set spark.ui.reverseProxyUrl in the master, workers and applications (Publish at a URL scenario).
  9. S3A, Iceberg or Delta Lake classes not found. Cause: A custom spark.driver.extraClassPath in customSparkConfig.properties replaces the chart classpath. Or the image tag changed without updating bundledJars. What to do: Remove the custom extraClassPath and keep bundledJars in sync with spark.image.tag.
  10. Other problem. Cause: Start with pod status and namespace events. What to do: Events in chronological order show what prevents the pod from starting.

What remains after uninstalling​

Terminal input
helm uninstall <RELEASE_NAME> -n <NAMESPACE>

With event logs on a PVC, the spark-history-events PVC remains in the cluster after helm uninstall. To start from scratch, delete it manually:

Terminal input
kubectl -n <NAMESPACE> delete pvc spark-history-events

The order for removing all components and the platform is in Uninstallation.

Lists and text in the values file​

Three parts of Spark configuration are not added to the chart's: when your values file defines them, they replace the chart's entirely.

  • Master and worker volume lists (spark.master.extraVolumes, spark.master.extraVolumeMounts and the worker equivalents). The chart already fills each with hadoop-config, spark-artifacts and custom-spark-defaults. When adding a volume, repeat these entries. The event logs PVC example in scenario 3 shows how.
  • tdp-spark.customSparkConfig.properties, a single text string. Start with a copy of the default content and add or adjust your lines.
  • The driver classpath. Your own spark.driver.extraClassPath within properties replaces the classpath the chart builds with jars from tdp-spark.bundledJars.

All parameters​

Filter by name or group. The chart prefix is already filled in. Keys without a prefix, such as those in the spark block, belong at the root of the values file.

The Spark image is specified in full in spark.image.repository: host, project and name in a single string. spark.image.registry is an optional prefix added before that reference to use a local mirror. When empty, as in the default, no prefix is added. To change the image, override spark.image.repository with the full reference.

From 3.0.2 on, the host and project are now in a single string in spark.image.repository, and spark.image.registry is empty.

43 of 43 parameters

ParameterDescriptionChart default
spark.enabledGeneralEnables Spark deploymenttrue
spark.image.repositoryGeneralSpark image host, project and name in a single stringregistry.tecnisys.com.br/tdp/images/spark
spark.image.registryGeneralOptional prefix added before image.repository for a local mirror. Empty means no prefix""
spark.image.tagGeneralSpark image tag. Update together with bundledJars4.0.2-3
spark.image.pullSecretsGeneralRegistry pull Secrets[tdp-registry]
spark.serviceAccount.nameGeneralServiceAccount of the master, workers and History Servertdp-spark-sa
global.compatibility.openshift.adaptSecurityContextGeneralOn OpenShift, lets the SCC assign UID and GID: auto, force or disabledauto
spark.service.ports.httpAccessWeb interface port in the master Service80
spark.service.ports.clusterAccessApplication submission port in the master Service7077
spark.worker.replicaCountWorkersWorker count2
spark.worker.autoscaling.enabledWorkersWorker HPAfalse
spark.worker.autoscaling.minReplicasWorkersMinimum workers with HPA2
spark.worker.autoscaling.maxReplicasWorkersMaximum workers with HPA10
spark.worker.autoscaling.targetCPUWorkersCPU usage that triggers scaling70
spark.worker.autoscaling.targetMemoryWorkersMemory usage that triggers scaling80
spark.master.resourcesResourcesMaster requests and limitsrequests cpu: 1, memory: 1Gi; limits cpu: 2, memory: 2Gi
spark.worker.resourcesResourcesEach worker's requests and limits. The worker advertises the memory limit minus 1 GiB to the master (3 GiB with a 4Gi limit), and the worker process uses about 1 GiB of heap; an executor larger than that is never scheduledrequests cpu: 1, memory: 1Gi; limits cpu: 2, memory: 4Gi
tdp-spark.hadoopConfigConfigurationcore-site.xml properties, such as fs.s3a.*fs.defaultFS: s3a://warehouse, S3A settings, no endpoint or keys
tdp-spark.customSparkConfig.propertiesConfigurationspark-defaults.conf content, a single text string. Defining it replaces the entire defaultevent logs disabled, reverse proxy enabled, spark.executor.memory 2g, spark.driver.memory 2g
tdp-spark.customSparkConfig.configMapNameConfigurationConfigMap providing spark-defaults.confspark-custom-defaults
tdp-spark.bundledJarsConfigurationImage jars added to the driver and executor classpath. Follows spark.image.tagS3A, Iceberg and Delta Lake from the image
spark.historyServer.enabledHistory ServerDeploys Spark History Server and enables event logsfalse
spark.historyServer.eventLog.dirHistory ServerEvent log directory when not using a PVCs3a://warehouse/spark-events
spark.historyServer.eventLog.createDirHistory ServerCreates the event log directory in an init containertrue
spark.historyServer.eventLog.persistence.enabledHistory ServerEvent logs on a PVC instead of the directoryfalse
spark.historyServer.eventLog.persistence.claimNameHistory ServerFixed event logs PVC namespark-history-events
spark.historyServer.eventLog.persistence.accessModesHistory ServerPVC access mode[ReadWriteMany]
spark.historyServer.eventLog.persistence.sizeHistory ServerPVC size10Gi
spark.historyServer.eventLog.persistence.storageClassHistory ServerPVC StorageClass (empty uses the cluster default)""
spark.historyServer.service.portHistory ServerHistory Server Service port18080
spark.historyServer.ingress.hostnameHistory ServerHistory Server Ingress hostnamespark-history.tdp.local
tdp-spark.integration.jupyter.enabledIntegrationGenerates Spark client configuration for Jupyterfalse
tdp-spark.iceberg.enabledIntegrationiceberg catalog in Hive Metastore, warehouse in S3false
tdp-spark.deltaLake.enabledIntegrationDelta Lake catalog and SQL extension, tables in S3false
TDP-Settings.gateway.ingress.enabledExposureRenders Ingress resourcesfalse
TDP-Settings.gateway.gatewayApi.enabledExposureRenders Gateway API HTTPRoutesfalse
spark.ingress.enabledExposureMaster interface Ingressfalse
gatewayApi.gateway.enabledExposureCreates a Gateway in the release namespacefalse
gatewayApi.parentRefsExposureGateway to which HTTPRoutes attach[]
gatewayApi.spark.enabledExposureMaster interface HTTPRoutefalse
gatewayApi.spark.hostnamesExposureMaster HTTPRoute hostnamesspark.tdp.local
gatewayApi.sparkHistory.enabledExposureHistory Server HTTPRoute, when enabledtrue
gatewayApi.sparkHistory.hostnamesExposureHistory Server HTTPRoute hostnamesspark-history.tdp.local

For the complete parameter list, consult the chart's values.yaml or run helm show values for the installed version.

Next steps​