Skip to main content
Version 3.0

Spark reading and writing
in the platform's lakehouse.

Five scenarios: the two files that connect Spark to the rest of the platform, the connection to S3 storage, the registration of Iceberg and Delta Lake tables in the Hive Metastore, and the Jupyter and Airflow side. Each one covers: the values file block commented line by line and a step-by-step with verification.

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

The chart tdp-spark connects Spark to S3-compatible storage through S3A, in tdp-spark.hadoopConfig, and to Iceberg and Delta Lake tables registered in Hive Metastore, with jars already in the image. For installation, workers and History Server, see Spark configuration.

Your environment

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

Scenarios​

The two files generated by the chart and what is already included in the image.

Spark connects to other components through two configuration files that the chart generates and mounts on the master and workers: core-site.xml and spark-defaults.conf. core-site.xml, generated from hadoopConfig, contains Hadoop properties, including those for S3A, Spark's connector to S3-compatible storage. spark-defaults.conf, generated from customSparkConfig.properties, contains Spark properties.

By default, the chart adds the classpath lines to spark-defaults.conf, and the S3A, Iceberg and Delta Lake jars are already in the image: applications do not need --packages or download anything. The S3 endpoint and keys have no default, and Iceberg and Delta Lake are disabled. When enabled, the chart adds their catalogs to spark-defaults.conf.

The following scenarios enable each integration: S3 storage (scenario 2), Iceberg and Delta Lake (scenario 3), Jupyter (scenario 4) and Airflow (scenario 5). Before enabling one of them, you want to know where it is configured.

core-site.xml

fs.defaultFS in the bucket warehouse through S3A, with path-style access and without SSL, but without endpoint or keys.

spark-defaults.conf

The contents of customSparkConfig.properties and the classpath containing S3A jars. Iceberg and Delta Lake are disabled.

In the image

S3A, Iceberg, Delta Lake and Hive Metastore client jars, and the Python libraries pyspark, delta-spark and pyiceberg.

The two files the chart generates

namespace <NAMESPACE>S3AThriftSparkmaster and workerscore-site.xmlspark-defaults.confS3 storageOzone S3 GatewayHive Metastoretable metadata
  1. Master and workers. The chart's pods. They read the core-site.xml and spark-defaults.conf files generated by the chart and run application executors.
  2. core-site.xml. Generated from hadoopConfig: Hadoop properties, such as the S3A endpoint and keys. Chart default: fs.defaultFS in the warehouse bucket, without endpoint or keys. (tdp-spark.hadoopConfig)
  3. spark-defaults.conf. Generated from customSparkConfig.properties, plus lines added by the chart: the classpath for jars in the image, Iceberg and Delta Lake catalogs and Hive Metastore when enabled. Chart default: Iceberg and Delta Lake disabled. (tdp-spark.customSparkConfig.properties)
  4. S3-compatible storage. Accessed through S3A using the endpoint and keys from hadoopConfig. With TDP charts, this is the Ozone S3 Gateway. The bucket must exist. Chart default: without endpoint or keys. (tdp-spark.hadoopConfig)
  5. Hive Metastore. Stores metadata for Iceberg and Delta Lake tables registered by name, accessed through the catalog's Thrift address. Chart default: disabled (Iceberg and Delta Lake disabled). (tdp-spark.iceberg.catalog.uri · tdp-spark.deltaLake.metastoreUri)
The two files generated by the chart and the components they reach. Click an element to see what it is and its corresponding default.

A map of the blocks, not a file to apply: each scenario provides the complete block. Click the markers.

1tdp-spark:
2hadoopConfig:
3 fs.s3a.endpoint: ...
4customSparkConfig:
5 properties: |
6 ...
7iceberg:
8 enabled: false
9deltaLake:
10 enabled: false
11integration:
12 jupyter:
13 enabled: false

All integrations are under the chart key, tdp-spark, not in the spark block.

  1. TDP block (linha 1). All integrations are under the chart key, tdp-spark, not in the spark block.
  2. core-site.xml (linha 2). Each hadoopConfig key becomes a core-site.xml property. This is where the S3 endpoint and keys are configured (scenario 2).
  3. spark-defaults.conf (linha 4). properties is a single string: setting your own replaces the entire default. Start with a copy of the default content.
  4. Iceberg (linha 7). When enabled, the chart adds the SQL extension and iceberg catalog in Hive Metastore to spark-defaults.conf (scenario 3).
  5. Delta Lake (linha 9). When enabled, the chart adds the SQL extension and Delta Lake catalog in spark_catalog (scenario 3).
  6. Jupyter (linha 11). When enabled, the chart generates Spark client configuration for notebooks (scenario 4).
Where each integration is configured in the values file

View the two files generated by the chart

The ConfigMaps show the core-site.xml and spark-defaults.conf used by the master and workers.

core-site.xml is in the ConfigMap tdp-spark-hadoop-config, and spark-defaults.conf in the ConfigMap from customSparkConfig.configMapName:

Terminal input
kubectl -n <NAMESPACE> get configmap tdp-spark-hadoop-config spark-custom-defaults -o yaml

Success criteria

core-site.xml contains the keys from hadoopConfig, and spark-defaults.conf contains the spark.driver.extraClassPath and spark.executor.extraClassPath lines with jars from the image.

Add any other Hadoop or Spark property the same way: in hadoopConfig for core-site.xml, or in your copy of customSparkConfig.properties for spark-defaults.conf.

When something goes wrong​

Troubleshooting

Paste the error message or choose a symptom. The response includes the cause, action and command.

  1. S3 access fails: missing endpoint or keys. Cause: The S3 endpoint and keys have no defaults in the chart. What to do: Set fs.s3a.endpoint, fs.s3a.access.key and fs.s3a.secret.key in hadoopConfig (S3 scenario), or move the keys to a Secret (Security - Spark).
  2. The bucket does not exist. Cause: Default paths use the warehouse bucket, which must exist in the storage system. What to do: Create the warehouse bucket in S3 storage before using Spark.
  3. Access denied after enabling Ozone security. Cause: With Ozone security (Kerberos) enabled, the S3 Gateway only accepts keys issued by Ozone. What to do: Use the key from the ozone-s3-credentials Secret or from an additional Ozone S3 user, and restart the pods (Security - Spark, Ozone security scenario).
  4. Delta Lake tables only work by path. Cause: Without deltaLake.metastoreUri or Iceberg enabled, there is no Hive Metastore to register Delta Lake tables by name. What to do: Set deltaLake.metastoreUri, or enable Iceberg, whose catalog already points to Hive Metastore (Lakehouse scenario).
  5. Iceberg, Delta Lake or S3A classes not found. Cause: A custom spark.driver.extraClassPath in customSparkConfig.properties replaces the chart's classpath. What to do: Remove the custom extraClassPath. Jars in the image are included through the classpath built by the chart.
  6. Another problem. Cause: Start with pod status and namespace events. What to do: Events in chronological order show what prevents the pod from starting.

Integration parameters​

Filter by name or group. The chart prefix is already filled in.

20 of 20 parameters

ParâmetroDescriptionChart default
tdp-spark.hadoopConfig.fs.defaultFSS3Default filesystems3a://warehouse
tdp-spark.hadoopConfig.fs.s3a.endpointS3S3-compatible storage endpointno default
tdp-spark.hadoopConfig.fs.s3a.access.keyS3S3 access key. Alternative: AWS_ACCESS_KEY_ID in a Secretno default
tdp-spark.hadoopConfig.fs.s3a.secret.keyS3S3 secret key. Alternative: AWS_SECRET_ACCESS_KEY in a Secretno default
tdp-spark.hadoopConfig.fs.s3a.path.style.accessS3Path-style access"true"
tdp-spark.hadoopConfig.fs.s3a.connection.ssl.enabledS3SSL for the S3 connection"false"
tdp-spark.hadoopConfig.fs.s3a.regionS3S3 regionus-east-1
tdp-spark.iceberg.enabledIcebergIceberg SQL extension and catalogfalse
tdp-spark.iceberg.catalog.nameIcebergCatalog name, the default for unqualified namesiceberg
tdp-spark.iceberg.catalog.uriIcebergHive Metastore Thrift addressthrift://tdp-hive-metastore-metastore.tdp.svc.cluster.local:9083
tdp-spark.iceberg.catalog.warehouseIcebergIceberg table warehouses3a://warehouse/hive
tdp-spark.iceberg.catalog.defaultNamespaceIcebergDefault catalog namespacedefault
tdp-spark.iceberg.storage.endpointIcebergWarehouse S3 endpoint. With Delta Lake enabled, applies to bothhttp://tdp-ozone-s3g-rest.tdp.svc.cluster.local:9878
tdp-spark.deltaLake.enabledDelta LakeDelta Lake SQL extension and catalog in spark_catalogfalse
tdp-spark.deltaLake.metastoreUriDelta LakeHive Metastore for Delta Lake tables. When empty, uses Iceberg's if enabled""
tdp-spark.deltaLake.storage.endpointDelta LakeWarehouse S3 endpoint when Iceberg is disabledhttp://tdp-ozone-s3g-rest.tdp.svc.cluster.local:9878
tdp-spark.deltaLake.storage.warehouseDelta LakeManaged table locations3a://warehouse/delta
tdp-spark.bundledJarsClasspathJars from the image in the driver and executor classpath. Follows the image tagS3A, Iceberg and Delta Lake from the image
tdp-spark.integration.jupyter.enabledJupyterGenerates Spark client configuration for Jupyterfalse
tdp-spark.integration.jupyter.sparkConfigJupyterClient spark-defaults.conf map. Your settings are merged with the defaultsplaceholders in spark.master and spark.driver.host

Next steps​