Skip to main content
Version 3.0

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

Four common scenarios, from the first installation to your own catalog. 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.3TypeapplicationAppVersion1.10.1
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+
Feature SupportS3supported

The tdp-iceberg chart schedules maintenance of Apache Iceberg tables in a Hive Metastore catalog as CronJobs: expire old snapshots, delete orphan files and, if enabled, compact small files. Each execution runs Spark in its own pod, with Iceberg, S3 and Hive Metastore jars already in the image, without a Spark cluster or downloading anything. For the table format, see Apache Iceberg - Concepts.

Your environment

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

Scenarios​

Install with chart defaults and run a job immediately, without waiting for the schedule.

This tab installs the chart with the defaults and runs a job immediately, to see the result without waiting for the schedule.

You already have Iceberg tables in Hive Metastore, with data in Ozone, and want maintenance to happen automatically. The chart creates no cluster or service: it schedules CronJobs, and each execution starts a pod that runs Spark, reads the catalog and calls Iceberg maintenance on each table. With defaults, jobs expect Hive Metastore and Ozone in namespace tdp with default release names. If this is not your setup, see scenario 4 first.

Jobs

expire-snapshots, daily, and remove-orphan-files, weekly, enabled. rewrite-data-files, compaction, disabled.

Tables

All Iceberg tables in the maintenance.catalog catalog while each job's tables list is empty.

Catalog and S3

Hive Metastore and the Ozone S3 Gateway in namespace tdp, with default release names, and the warehouse at s3a://warehouse/hive.

Before you begin

The TDP license in the cluster and, in the release namespace, the tdp-registry pull Secret and s3-credentials Secret containing S3 keys. The chart creates neither.

Job runtime

Spark 4.0.2 with Iceberg 1.10.1 (Spark runtime) and Scala 2.13. The subchart Spark cluster remains disabled and jobs do not use it.

What the chart creates and what each run talks to

namespace <NAMESPACE>createsThriftS3A--fromCronJobexpire-snapshotsCronJobremove-orphan-filesCronJobrewrite-data-filesJob podexpire-snapshots · Spark in the podSecret s3-credentialsS3 keysConfigMapspark-defaults.conf · scriptSecret tdp-registryimage pullServiceAccounticeberg-maintenanceSpark clusterspark subchartHive Metastorenamespace tdpOzone S3 Gatewaynamespace tdpManual executionkubectl create job
  1. CronJob expire-snapshots. Expires snapshots older than retentionDays, always keeping each table's latest retainLast snapshots, and deletes files referenced only by expired snapshots. A new execution does not start while the previous execution of the same job is still running. The name is <RELEASE_NAME>-tdp-iceberg-expire-snapshots, or the release name followed by -expire-snapshots when it already contains tdp-iceberg. Chart default: enabled, daily · schedule in schedule. (maintenance.jobs.expireSnapshots)
  2. CronJob remove-orphan-files. Deletes files in the table directory not referenced by any snapshot, provided they are older than olderThanDays. A new execution does not start while the previous execution of the same job is still running. The name is <RELEASE_NAME>-tdp-iceberg-remove-orphan-files, or the release name followed by -remove-orphan-files when it already contains tdp-iceberg. Chart default: enabled, weekly on Sundays · schedule in schedule. (maintenance.jobs.removeOrphanFiles)
  3. CronJob rewrite-data-files. Compacts small data files. Uses more resources, so it is disabled by default. A new execution does not start while the previous execution of the same job is still running. The name is <RELEASE_NAME>-tdp-iceberg-rewrite-data-files, or the release name followed by -rewrite-data-files when it already contains tdp-iceberg. Chart default: disabled · weekly on Saturdays when enabled. (maintenance.jobs.rewriteDataFiles.enabled)
  4. Job pod. Each execution starts a pod running Spark inside itself, without a Spark cluster. Processes the tables listed in tables or, with an empty list, every Iceberg table in the catalog, logs one line per table and finishes with a failure if any table fails. Chart default: TDP Spark image, with Iceberg, S3 and Hive Metastore jars. (maintenance.spark.image · maintenance.spark.resources)
  5. S3 keys Secret. The pod reads the S3 access key and secret key from it. Create it in the release namespace before the first execution. Chart default: s3-credentials, keys access-key and secret-key. (maintenance.spark.s3Credentials)
  6. Maintenance ConfigMap. Stores spark-defaults.conf, generated from maintenance.spark.config, and the script jobs execute. Mounted in each pod. Name: <RELEASE_NAME>-tdp-iceberg-maintenance. Chart default: iceberg catalog in Hive Metastore and Ozone S3, in namespace tdp. (maintenance.spark.config)
  7. Pull Secret. The registry credential the cluster uses to download the jobs' image. Must exist in the release namespace before installation; the chart does not create it. Chart default: tdp-registry. (global.imagePullSecrets · maintenance.spark.imagePullSecrets)
  8. Jobs ServiceAccount. Job pod identity, created by the chart with a Role and RoleBinding without rules: jobs do not call the Kubernetes API. Chart default: iceberg-maintenance. (serviceAccount · rbac)
  9. Subchart Spark cluster. Optional standalone Spark cluster, with master and workers. Jobs do not use it; for a shared Spark cluster, use the chart tdp-spark. Chart default: disabled. (spark.enabled)
  10. Hive Metastore. Stores the Iceberg table catalog. The pod reaches it through the Thrift address in spark.sql.catalog.iceberg.uri. Chart default: chart tdp-hive-metastore in namespace tdp, with the default release name. (maintenance.spark.config → spark.sql.catalog.iceberg.uri)
  11. S3 storage. Where table files are stored, in the warehouse from spark.sql.catalog.iceberg.warehouse. The pod connects through S3A, at the spark.hadoop.fs.s3a.endpoint endpoint. Chart default: chart tdp-ozone in namespace tdp, with the default release name; warehouse s3a://warehouse/hive. (maintenance.spark.config → spark.hadoop.fs.s3a.endpoint)
  12. Manual execution. kubectl create job --from=cronjob creates a Job from the CronJob immediately, without waiting for the schedule.
What the chart creates in the namespace with defaults, and what each execution communicates with. 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 it with the tdp-license chart, as in Licensing Configuration, before continuing.

Create the registry pull Secret

The jobs' image comes from the private Tecnisys registry.

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 Secret must be in the release namespace before installation. If the namespace does not exist yet, create it first with kubectl create namespace <NAMESPACE>. Credentials and precautions are in Prerequisites.

Create the Secret containing S3 keys

Jobs read the access key and secret key from a Secret in the release namespace.

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

Without Ozone Kerberos, the default, the S3 Gateway accepts any nonempty key pair. With Kerberos enabled, Ozone issues the ozone-s3-credentials Secret, and jobs read from it: see Security - Iceberg.

Install with defaults

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

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

Without --version, Helm installs the chart's latest published version. With it, the version for this documentation.

Success criteria

Terminal input
kubectl -n <NAMESPACE> get cronjobs

The expire-snapshots and remove-orphan-files CronJobs appear, with the release prefix. At the end of installation, Helm also shows each enabled job's schedule and the catalog and S3 addresses jobs will use.

Run a job now

A Job created from the CronJob executes immediately, without waiting for the schedule.

Terminal input
kubectl -n <NAMESPACE> create job --from=cronjob/<RELEASE_NAME>-tdp-iceberg-expire-snapshots <RELEASE_NAME>-tdp-iceberg-expire-snapshots-manual
kubectl -n <NAMESPACE> logs -f job/<RELEASE_NAME>-tdp-iceberg-expire-snapshots-manual

CronJob names derive from the release: <RELEASE_NAME>-tdp-iceberg- followed by expire-snapshots, remove-orphan-files or rewrite-data-files. When the release name already contains tdp-iceberg, only the release name followed by the job name. With the release iceberg, the CronJob is iceberg-tdp-iceberg-expire-snapshots. With the release named tdp-iceberg, it is tdp-iceberg-expire-snapshots.

Success criteria

The log contains one line per table, with the command executed, and ends with the completed table count (tables done). In a catalog without Iceberg tables, the job logs no Iceberg tables found in catalog and finishes without doing anything.
If the pod does not start or the job fails

Namespace events, in chronological order, show the reason:

Terminal input
kubectl -n <NAMESPACE> get pods -l component=maintenance
kubectl -n <NAMESPACE> get events --sort-by=.lastTimestamp

Then look up the message in When something goes wrong.

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 by the license. Cause: The TDP license is missing or invalid in the cluster. What to do: Install or renew the TDP license and check with the command below.
  2. Job pod in ImagePullBackOff. Cause: The tdp-registry Secret does not exist in the release namespace. What to do: Create the pull Secret in the release namespace with your registry credentials (scenario 1).
  3. Job pod in CreateContainerConfigError. Cause: The Secret specified in maintenance.spark.s3Credentials.secretName does not exist in the release namespace, or lacks the keys specified in accessKeyKey and secretKeyKey. What to do: Create the Secret in the release namespace with the expected keys (scenario 1), or point to yours in Security - Iceberg.
  4. Job finishes as Failed. Cause: At least one table failed. The job continues with the others and only finishes with a failure at the end. What to do: In the job log, each FAILED line contains the table and error, and the last line lists failed tables.
  5. no Iceberg tables found in catalog. Cause: The catalog targeted by the jobs has no Iceberg tables: the configured Hive Metastore is not the one containing your tables, or maintenance.catalog does not match spark.sql.catalog.<nome> in maintenance.spark.config. What to do: Check Catalog URI, Warehouse and S3 endpoint in the Helm output at the end of installation (scenario 4).
  6. remove-orphan-files rejects the interval. Cause: olderThanDays below Iceberg's accepted minimum. What to do: Use olderThanDays at least equal to the minimum in the parameter table and longer than your longest write job.
  7. Other problem. Cause: Start with job pod status and namespace events. What to do: Events in chronological order show what prevents the pod from starting.

To uninstall, run helm uninstall <RELEASE_NAME> -n <NAMESPACE>. CronJobs are removed with the release. Tables and their data are unchanged.

All parameters​

Filter by name or group. This chart's keys belong at the values file root, without a prefix.

35 of 35 parameters

ParameterDescriptionChart default
maintenance.enabledJobsCreates maintenance CronJobstrue
maintenance.catalogJobsCatalog maintained by jobs (spark.sql.catalog.<nome>)iceberg
maintenance.jobs.expireSnapshots.enabledJobsEnables expire-snapshotstrue
maintenance.jobs.expireSnapshots.scheduleJobsexpire-snapshots schedule (cron)0 2 * * *
maintenance.jobs.expireSnapshots.retentionDaysJobsSnapshots older than this number of days expire7
maintenance.jobs.expireSnapshots.retainLastJobsLatest snapshots always retained in each table1
maintenance.jobs.removeOrphanFiles.enabledJobsEnables remove-orphan-filestrue
maintenance.jobs.removeOrphanFiles.scheduleJobsremove-orphan-files schedule (cron)0 3 * * 0
maintenance.jobs.removeOrphanFiles.olderThanDaysJobsOnly files older than this number of days are deleted. Minimum 1. Keep longer than your longest write job3
maintenance.jobs.rewriteDataFiles.enabledJobsEnables rewrite-data-files (uses more resources)false
maintenance.jobs.rewriteDataFiles.scheduleJobsrewrite-data-files schedule (cron)0 1 * * 6
maintenance.jobs.rewriteDataFiles.optionsJobsrewrite_data_files options, for example min-input-files: "5"{}
maintenance.jobs.<job>.tablesJobsnamespace.tabela list. Empty = every Iceberg table in the catalog[]
maintenance.spark.image.repositoryJob podsJobs image, with host, project and nameregistry.tecnisys.com.br/tdp/images/spark
maintenance.spark.image.tagJob podsJobs image tag. Classpath jar paths follow the tag4.0.2-3
maintenance.spark.image.pullPolicyJob podsJobs image pull policyIfNotPresent
maintenance.spark.imagePullSecretsJob podsExtra pull Secrets for jobs only, added to global.imagePullSecrets[]
maintenance.spark.resources.requests.cpuJob podsCPU reserved for each job pod1
maintenance.spark.resources.requests.memoryJob podsMemory reserved for each job pod2Gi
maintenance.spark.resources.limits.cpuJob podsCPU limit for each job pod2
maintenance.spark.resources.limits.memoryJob podsMemory limit for each job pod4Gi
maintenance.spark.configCatalog and S3Spark properties written to the jobs' spark-defaults.conf. Keys you define are merged with defaultsiceberg catalog in Hive Metastore and Ozone S3, in namespace tdp
maintenance.spark.s3Credentials.secretNameCatalog and S3Secret containing S3 keys, in the release namespaces3-credentials
maintenance.spark.s3Credentials.accessKeyKeyCatalog and S3Secret key containing the access keyaccess-key
maintenance.spark.s3Credentials.secretKeyKeyCatalog and S3Secret key containing the secret keysecret-key
global.imagePullSecretsGeneralPull Secrets for jobs and the Spark subchart, in the release namespace[tdp-registry]
global.compatibility.openshift.adaptSecurityContextGeneralSecurity context compatibility with OpenShiftforce
serviceAccount.createGeneralCreates the jobs' ServiceAccounttrue
serviceAccount.nameGeneralJobs ServiceAccount nameiceberg-maintenance
rbac.createGeneralCreates the jobs' Role and RoleBindingtrue
rbac.rulesGeneralRole rules. Jobs do not call the Kubernetes API, only for your extensions[]
spark.enabledSpark subchartDeploys the subchart standalone Spark cluster (jobs do not use it)false
spark.image.registrySpark subchartOptional image prefix for a local mirror. Empty = no prefix""
spark.image.repositorySpark subchartFull subchart image referenceregistry.tecnisys.com.br/tdp/images/spark
spark.image.tagSpark subchartSubchart image tag4.0.2-3

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

Next steps​