Skip to main content
Version 3.0

S3 keys for the Iceberg jobs
and defined permissions for the pods.

Two scenarios: delivering the S3 keys to the jobs, with or without Ozone Kerberos, and the permissions the job pods run with in the cluster. Each one covers: the chart default, 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 exposes no service and has no login: security lies in the S3 keys that the jobs read from a Secret in the release namespace and in the permissions of the job pods, which the chart already defines as restricted. For the jobs, schedules and catalog, see Iceberg Configuration.

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​

The default Secret or the Secret that Ozone issues when Kerberos is on.

The jobs write to Ozone through S3 and need an access key and a secret key. They read them from a Secret in the release namespace, and which pair works depends on how Ozone is set up. Without Ozone Kerberos, which is the default, the S3 Gateway accepts any non-empty pair: just create the s3-credentials Secret. With Kerberos on, Ozone issues the keys in the ozone-s3-credentials Secret, in its own namespace, and the jobs start reading that Secret.

Chart default

The s3-credentials Secret, with the keys access-key and secret-key, in maintenance.spark.s3Credentials. The chart does not create the Secret.

With Ozone Kerberos

The ozone-s3-credentials Secret, with the keys aws_access_key_id and aws_secret_access_key, copied to the release namespace.

The jobs' S3 keys

How Ozone is set up

Your choice changes the commands and passages below.

namespace <NAMESPACE>envS3AJob podSpark in the pod · S3ASecret s3-credentialsaccess-key · secret-keyServiceAccounticeberg-maintenanceOzone S3 Gatewayno authentication
  1. Job pod. Receives the access key and the secret key from the Secret as environment variables, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, which Spark uses in S3A. It runs as a non-root user, with a read-only root filesystem and no capabilities at all. Chart default: keys from s3-credentials. (maintenance.spark.s3Credentials · securityContext)
  2. Secret s3-credentials. Created by you in the release namespace, with any non-empty key pair when Ozone runs without Kerberos. Chart default: s3-credentials, keys access-key and secret-key. (maintenance.spark.s3Credentials.secretName: s3-credentials)
  3. ServiceAccount and Role. Created by the chart, with a RoleBinding. The Role comes with no rules: the jobs do not call the Kubernetes API. Rules only come in for your own extensions. Chart default: iceberg-maintenance · empty rules. (serviceAccount · rbac.rules)
  4. Ozone S3 Gateway. Without Ozone Kerberos, which is the default, it accepts any request, even with made-up keys, and the ozone-s3-credentials Secret does not exist. Chart default: no authentication. (tdp-ozone.kerberos.enabled)

How Ozone is set up: No Kerberos (default)

namespace <NAMESPACE>envS3AJob podSpark in the pod · S3ASecret s3-credentialsaccess-key · secret-keyServiceAccounticeberg-maintenanceOzone S3 Gatewayno authentication
  1. Job pod. Receives the access key and the secret key from the Secret as environment variables, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, which Spark uses in S3A. It runs as a non-root user, with a read-only root filesystem and no capabilities at all. Chart default: keys from s3-credentials. (maintenance.spark.s3Credentials · securityContext)
  2. Secret s3-credentials. Created by you in the release namespace, with any non-empty key pair when Ozone runs without Kerberos. Chart default: s3-credentials, keys access-key and secret-key. (maintenance.spark.s3Credentials.secretName: s3-credentials)
  3. ServiceAccount and Role. Created by the chart, with a RoleBinding. The Role comes with no rules: the jobs do not call the Kubernetes API. Rules only come in for your own extensions. Chart default: iceberg-maintenance · empty rules. (serviceAccount · rbac.rules)
  4. Ozone S3 Gateway. Without Ozone Kerberos, which is the default, it accepts any request, even with made-up keys, and the ozone-s3-credentials Secret does not exist. Chart default: no authentication. (tdp-ozone.kerberos.enabled)

How Ozone is set up: With Kerberos

namespace <NAMESPACE>envS3AcopyJob podSpark in the pod · S3ASecret ozone-s3-credentialsaws_access_key_id · aws_secret_access_keyServiceAccounticeberg-maintenanceOzone S3 GatewayAWS Signature v4ozone-s3-credentialsOzone namespace
  1. Job pod. Receives the access key and the secret key from the Secret as environment variables, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, which Spark uses in S3A. It runs as a non-root user, with a read-only root filesystem and no capabilities at all. Chart default: keys from s3-credentials. (maintenance.spark.s3Credentials · securityContext)
  2. Secret ozone-s3-credentials. A copy, in the release namespace, of the Secret that Ozone issues when Kerberos is on. The jobs now read from it, using the name and keys set in s3Credentials. Chart default: s3-credentials, keys access-key and secret-key. (maintenance.spark.s3Credentials.secretName: ozone-s3-credentials)
  3. ServiceAccount and Role. Created by the chart, with a RoleBinding. The Role comes with no rules: the jobs do not call the Kubernetes API. Rules only come in for your own extensions. Chart default: iceberg-maintenance · empty rules. (serviceAccount · rbac.rules)
  4. Ozone S3 Gateway. With Ozone Kerberos on, it validates the signatures against the keys that the Ozone Manager issued. Chart default: no authentication. (tdp-ozone.kerberos.enabled)
  5. Original Secret. Issued by the Ozone chart, only in the Ozone namespace. For a component in another namespace, copy it, and copy it again after a key change. Chart default: only with Ozone Kerberos on.
Switch above: with Ozone Kerberos, the jobs read a copy of the Secret that Ozone issues in its own namespace.

Without Kerberos. Create the Secret with the name and keys the chart expects. With Ozone without Kerberos, any non-empty pair works. Without Kerberos: Best suited when Ozone follows the default, without Kerberos.

Create the s3-credentials Secret

In the release namespace, before the jobs first run.

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

It worked when

Terminal input
kubectl -n <NAMESPACE> describe secret s3-credentials

The Secret lists the keys access-key and secret-key. Run a job right away, as in Iceberg Configuration: the pod starts and the log shows one line per table.

With Kerberos. The ozone-s3-credentials exists only in the Ozone namespace. Copy it to the release namespace and set its name and keys in the values file. After a key change in Ozone, copy it again. With Kerberos: Best suited when Ozone security is on: the S3 Gateway only accepts the keys that Ozone issues.

Click the markers to understand each line.

1maintenance:
2spark:
3 s3Credentials:
4 secretName: ozone-s3-credentials
5 accessKeyKey: aws_access_key_id
6 secretKeyKey: aws_secret_access_key

The Secret in the release namespace, not in the Ozone one.

  1. Secret name (linha 4). The Secret in the release namespace, not in the Ozone one.
  2. Access key (linha 5). The Secret key that holds the access key. The pod receives it in AWS_ACCESS_KEY_ID, which Spark uses in S3A.
  3. Secret key (linha 6). The Secret key that holds the secret key, received in AWS_SECRET_ACCESS_KEY.
The jobs reading ozone-s3-credentials

Copy the Ozone Secret to the release namespace

The jobs only read Secrets from their own namespace.

Terminal input
kubectl -n <NAMESPACE> create secret generic ozone-s3-credentials \
--from-literal=aws_access_key_id="$(kubectl -n <SHARED_NAMESPACE> get secret ozone-s3-credentials -o jsonpath='{.data.aws_access_key_id}' | base64 -d)" \
--from-literal=aws_secret_access_key="$(kubectl -n <SHARED_NAMESPACE> get secret ozone-s3-credentials -o jsonpath='{.data.aws_secret_access_key}' | base64 -d)"

With Iceberg in the same namespace as Ozone, the Secret is already there and this step is not needed. Per-application keys, instead of the administrator key, are in Security - Apache Ozone.

Apply to the release

The next job runs already read the new Secret.

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

It worked when

At the end, Helm shows the name of the Secret and the keys the jobs will read. Run a job right away, as in Iceberg Configuration: the log shows one line per table, with no access error.
If the pod stays in CreateContainerConfigError

The Secret is not in the release namespace, or the name of a key does not match. See When something goes wrong.

How to turn on Ozone Kerberos is in Security - Apache Ozone.

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. Job pod in CreateContainerConfigError. Cause: The Secret named in maintenance.spark.s3Credentials.secretName does not exist in the release namespace, or it does not have the keys named in accessKeyKey and secretKeyKey. The ozone-s3-credentials Secret only exists in the Ozone namespace until you copy it. What to do: Create or copy the Secret in the release namespace and check the key names (scenario 1).
  2. S3 key rejected after a key change in Ozone. Cause: The copy of ozone-s3-credentials in the release namespace kept the old key. What to do: Copy the Secret again, as in scenario 1. The next job run already reads the new key.
  3. Another problem. Cause: Start with the state of the job pods and the namespace events. What to do: The events in time order show what keeps the pod from starting.

All parameters​

Only the security parameters. The keys of this chart are at the root of the values file, with no prefix.

14 of 14 parameters

ParameterDescriptionChart default
maintenance.spark.s3Credentials.secretNameS3 keysSecret with the S3 keys, in the release namespaces3-credentials
maintenance.spark.s3Credentials.accessKeyKeyS3 keysSecret key that holds the access keyaccess-key
maintenance.spark.s3Credentials.secretKeyKeyS3 keysSecret key that holds the secret keysecret-key
serviceAccount.createIdentityCreates the ServiceAccount for the jobstrue
serviceAccount.nameIdentityName of the ServiceAccount for the jobsiceberg-maintenance
serviceAccount.annotationsIdentityServiceAccount annotations{}
rbac.createIdentityCreates the Role and RoleBinding for the jobstrue
rbac.rulesIdentityRole rules. The jobs do not call the Kubernetes API, only for your own extensions[]
podSecurityContext.runAsNonRootPodsPod runs as a non-root usertrue
podSecurityContext.seccompProfile.typePodsPod seccomp profileRuntimeDefault
securityContext.allowPrivilegeEscalationPodsAllows privilege escalation in the containerfalse
securityContext.readOnlyRootFilesystemPodsContainer root filesystem is read-onlytrue
securityContext.runAsNonRootPodsContainer runs as a non-root usertrue
securityContext.capabilities.dropPodsLinux capabilities dropped from the container[ALL]

Next steps​