Skip to main content
Version 3.0

Delta tables in order,
with maintenance scheduled in the cluster.

Six common scenarios, from the first installation to the chart's own Spark cluster. 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.1
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+
Feature SupportS3supported

The tdp-deltalake chart runs, in scheduled jobs (CronJobs), the maintenance of the lakehouse's Delta Lake tables: VACUUM, OPTIMIZE, OPTIMIZE ZORDER BY, and DESCRIBE HISTORY. Each job runs Spark in its own pod, finds the tables in the Hive Metastore, and reads the files from S3 storage. For the format and the transaction log, see Delta Lake - Concepts.

Your environment

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

Scenarios​

Install with the defaults, check the CronJobs, and run a job without waiting for the schedule.

This scenario installs the chart with the defaults, checks the maintenance jobs it creates, and runs one of them without waiting for the schedule. With the defaults, the chart creates two CronJobs: VACUUM, daily, which deletes the files that the transaction log no longer references, and OPTIMIZE, weekly, which compacts small files into larger ones. Each run processes all the Delta tables registered in the Hive Metastore.

The Hive Metastore and Ozone are already in the cluster, and you want the Delta tables to start receiving maintenance. The defaults expect the Hive Metastore and Ozone in the tdp namespace. If yours are in another namespace, also see scenario 5 before installing.

Enabled jobs

VACUUM and OPTIMIZE, with the schedules in maintenance.jobs.vacuum.schedule and maintenance.jobs.optimize.schedule. OPTIMIZE ZORDER BY and DESCRIBE HISTORY disabled.

Tables

Empty tables list in each job: all Delta tables registered in the Hive Metastore.

Metastore and S3

Addresses in maintenance.spark.config, pointing to the Hive Metastore and the Ozone S3 Gateway in the tdp namespace, with the warehouse in spark.sql.warehouse.dir.

Job runtime

Spark 4.0.2 with Delta Lake 4.0.1 and Scala 2.13. The subchart's Spark cluster is off and the jobs do not use it.

Before you start

A valid TDP license, the tdp-registry pull Secret and the S3 keys Secret in the release namespace, and the Hive Metastore and Ozone with the warehouse.

Also in the namespace

A ConfigMap with the jobs' Spark configuration and a dedicated ServiceAccount, without permissions on the Kubernetes API.

What comes up in the namespace with the chart defaults

namespace <NAMESPACE>ThriftS3ACronJobs ×2VACUUM · OPTIMIZEConfigMapspark-defaults.confSecrets3-credentialsPull Secrettdp-registryServiceAccountfor the jobsHive Metastorenamespace tdpS3 Gateway (Ozone)namespace tdp
  1. Maintenance CronJobs. One CronJob per enabled job: VACUUM, OPTIMIZE. Each run is a pod with Spark, which processes the tables listed in tables or, with an empty list, all Delta tables in the Hive Metastore. The job logs one line per table and fails when any of them fails. Chart default: VACUUM and OPTIMIZE enabled; OPTIMIZE ZORDER BY and DESCRIBE HISTORY disabled. (maintenance.enabled · maintenance.jobs)
  2. Jobs ConfigMap. Holds the spark-defaults.conf, assembled from maintenance.spark.config, and the script each job runs. The keys you define are merged into the defaults. Chart default: Hive Metastore and Ozone S3 in the tdp namespace. (maintenance.spark.config)
  3. S3 keys Secret. Created by you before the deploy, in the release namespace. The jobs read the access key and the secret key from it. Chart default: s3-credentials, with the access-key and secret-key keys. (maintenance.spark.s3Credentials)
  4. Pull Secret. The Tecnisys registry credentials, created by you in the namespace before the installation. They apply to the jobs, to the self-test, and to the Spark subchart. Chart default: tdp-registry. (global.imagePullSecrets)
  5. ServiceAccount. Created by the chart for the job pods, with a Role that has no rules: the jobs do not call the Kubernetes API. Chart default: deltalake-maintenance. (serviceAccount.name · rbac.rules)
  6. Hive Metastore. Where the jobs look for the Delta tables, through the Thrift address in spark.hadoop.hive.metastore.uris. Chart default: tdp-hive-metastore-metastore, in the tdp namespace. (maintenance.spark.config["spark.hadoop.hive.metastore.uris"])
  7. S3 storage. Where the table files live, in the spark.sql.warehouse.dir warehouse. The jobs reach it through S3A, with the keys from the Secret. Chart default: tdp-ozone-s3g-rest, in the tdp namespace; warehouse s3a://warehouse/delta. (maintenance.spark.config["spark.hadoop.fs.s3a.endpoint"])
What comes up in the namespace with the chart defaults. Click an element to see what it is and the corresponding default.

Check the TDP license

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

Terminal input
kubectl get platformlicenses -A

It worked when

The license appears in the list. If it does not, install the tdp-license chart before continuing, as in License Configuration.

Create the pull Secret in the namespace

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

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>

The user and the token are your registry ones. How to obtain them is in Prerequisites. The Secret must exist in the namespace before the installation: if the namespace does not exist yet, create it first with kubectl create namespace <NAMESPACE>.

It worked when

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

Create the S3 keys Secret

The jobs read the access key and the secret key from this Secret, in the release namespace.

Terminal input
kubectl -n <NAMESPACE> create secret generic s3-credentials \
--from-literal=access-key='<ACCESS_KEY>' \
--from-literal=secret-key='<SECRET_KEY>'

With Ozone security off, which is its default, any non-empty pair works. With it on, the jobs use the keys that Ozone issues: see Security - Delta Lake.

Install the chart

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

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

Without --version, Helm installs the latest published version of the chart. This documentation's version is 3.0.3. With your own settings, create your values file and add -f <VALUES_FILE>.

It worked when

Terminal input
kubectl -n <NAMESPACE> get cronjobs

The VACUUM and OPTIMIZE CronJobs appear, and the Helm output lists the enabled jobs with the schedules. The names derive from the release: <RELEASE_NAME>-tdp-deltalake-vacuum, or <RELEASE_NAME>-vacuum when the release name already contains tdp-deltalake. The same applies to optimize, optimize-zorder, and describe-history.

If the installation is refused or the pods do not start

A refusal with license check failed is the license; ImagePullBackOff is the pull Secret; CreateContainerConfigError is the S3 keys Secret. All three are in When something goes wrong.

Run a job now

A manual run, from the CronJob, without waiting for the schedule.

With the release named tdp-deltalake, as in the example below:

Terminal input
kubectl -n <NAMESPACE> create job --from=cronjob/tdp-deltalake-vacuum tdp-deltalake-vacuum-manual
kubectl -n <NAMESPACE> logs -f job/tdp-deltalake-vacuum-manual

It worked when

The log shows one line per table, with the command run, and ends with the count of completed tables. With no Delta table in the metastore, the log says there is nothing to do.
If the job ends with an error

The job continues with the other tables when one fails, and ends with an error listing the ones that failed. The FAILED line carries the table and the message. See When something goes wrong.

When something goes wrong​

Troubleshooting

Paste the error message or pick the symptom. The answer comes with the cause, what to do, and the command.

  1. Installation refused: license check failed. Cause: The TDP license is missing or invalid in the cluster. What to do: Install or renew the TDP license and check its status before repeating the installation.
  2. Job pods in ImagePullBackOff. Cause: The tdp-registry pull Secret does not exist in the release namespace. What to do: Create the tdp-registry Secret with your registry credentials (scenario 1).
  3. Job pod in CreateContainerConfigError. Cause: The S3 keys Secret does not exist in the release namespace, or does not have the keys given in accessKeyKey and secretKeyKey. What to do: Create the Secret with the key names the values file indicates (scenario 1).
  4. Job failed with FAILED on a table. Cause: One of the tables failed. The job continues with the others, logs one line per table, and ends with an error, listing the tables that failed. What to do: Read the run log: the FAILED line carries the table and the Spark message.
  5. no Delta tables to process; nothing to do. Cause: With an empty tables list, no Delta table was found in the Hive Metastore. In Z-ORDER, no tables entry has columns in zOrderBy. What to do: Check the tables in the metastore or list them in maintenance.jobs.<job>.tables. In Z-ORDER, provide the columns of each table (scenario 3).
  6. Job cannot reach the metastore or S3. Cause: The default addresses point to the Hive Metastore and Ozone in the tdp namespace. What to do: Set both addresses in maintenance.spark.config (scenario 5). The release notes show the addresses in use.
  7. Time travel or reading an old version fails. Cause: retentionHours below the default: VACUUM deleted files of versions that were still being read. What to do: Keep retentionHours at the chart default or above. Deleted files do not come back.
  8. Another problem. Cause: Start with the CronJobs, the runs, and the namespace events. What to do: The events in time order show what keeps the pod from starting.

To uninstall, helm uninstall <RELEASE_NAME> -n <NAMESPACE>. The tables and their data are not changed.

All parameters​

Filter by name or by group. The keys live at the root of the values file.

33 of 33 parameters

ParameterDescriptionChart default
maintenance.enabledJobsCreates the maintenance CronJobstrue
maintenance.jobs.vacuum.enabledJobsEnables VACUUMtrue
maintenance.jobs.vacuum.scheduleJobsVACUUM schedule (daily at 2 AM)0 2 * * *
maintenance.jobs.vacuum.retentionHoursJobsUnreferenced files older than this number of hours are deleted168
maintenance.jobs.optimize.enabledJobsEnables OPTIMIZEtrue
maintenance.jobs.optimize.scheduleJobsOPTIMIZE schedule (Sundays at 3 AM)0 3 * * 0
maintenance.jobs.optimizeZOrder.enabledJobsEnables OPTIMIZE ZORDER BYfalse
maintenance.jobs.optimizeZOrder.scheduleJobsOPTIMIZE ZORDER BY schedule (Saturdays at 1 AM)0 1 * * 6
maintenance.jobs.optimizeZOrder.tablesJobs{table, zOrderBy} entries. Only these tables are processed[]
maintenance.jobs.describeHistory.enabledJobsEnables DESCRIBE HISTORYfalse
maintenance.jobs.describeHistory.scheduleJobsDESCRIBE HISTORY schedule (daily at 6 AM)0 6 * * *
maintenance.jobs.<job>.tablesJobsdatabase.table or table path (s3a://...). Empty = all Delta tables in the metastore[]
maintenance.spark.image.repositoryImage and resourcesJobs' imageregistry.tecnisys.com.br/tdp/images/spark
maintenance.spark.image.tagImage and resourcesJobs' image tag4.0.2-3
maintenance.spark.imagePullSecretsImage and resourcesExtra pull secrets, only for the jobs, added to global.imagePullSecrets[]
maintenance.spark.resources.requests.cpuImage and resourcesCPU reserved for each job's pod1
maintenance.spark.resources.requests.memoryImage and resourcesMemory reserved for each job's pod2Gi
maintenance.spark.resources.limits.cpuImage and resourcesCPU limit for each job's pod2
maintenance.spark.resources.limits.memoryImage and resourcesMemory limit for each job's pod4Gi
maintenance.spark.config["spark.hadoop.hive.metastore.uris"]Metastore and S3Hive Metastore addressthrift://tdp-hive-metastore-metastore.tdp.svc.cluster.local:9083
maintenance.spark.config["spark.sql.warehouse.dir"]Metastore and S3Warehouse of the Delta tabless3a://warehouse/delta
maintenance.spark.config["spark.hadoop.fs.s3a.endpoint"]Metastore and S3S3 endpoint (Ozone S3 Gateway)http://tdp-ozone-s3g-rest.tdp.svc.cluster.local:9878
maintenance.spark.config["spark.databricks.delta.retentionDurationCheck.enabled"]Metastore and S3Delta Lake retention check. When off, it accepts retentionHours below the defaultfalse
maintenance.spark.s3Credentials.secretNameMetastore and S3Secret with the S3 keys, in the release namespaces3-credentials
maintenance.spark.s3Credentials.accessKeyKeyMetastore and S3Secret key holding the access keyaccess-key
maintenance.spark.s3Credentials.secretKeyKeyMetastore and S3Secret key holding the secret keysecret-key
global.imagePullSecretsRegistry and platformPull secrets for the jobs and the Spark subchart[tdp-registry]
global.compatibility.openshift.adaptSecurityContextRegistry and platformSecurity context adjustment on OpenShiftforce
spark.enabledSpark subchartDeploys the subchart's Spark standalone cluster (the jobs do not use it)false
spark.image.registrySpark subchartOptional image prefix, for a local mirror""
spark.image.repositorySpark subchartFull image reference of the subchartregistry.tecnisys.com.br/tdp/images/spark
spark.image.tagSpark subchartSubchart image tag4.0.2-3
test.enabledSelf-testCreates the self-test Jobfalse

For the complete list of parameters, run helm show values for the installed version.

Next steps​