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.
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
- 1 · S3 keys
- 2 · Pod identity
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.
The s3-credentials Secret, with the keys access-key and secret-key, in maintenance.spark.s3Credentials. The chart does not create the Secret.
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
- 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) - 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) - 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) - 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)
- 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) - 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) - 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) - 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
- 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) - 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) - 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) - 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) - 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.
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.
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
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.
1maintenance:2spark:3 s3Credentials:4 secretName: ozone-s3-credentials5 accessKeyKey: aws_access_key_id6 secretKeyKey: aws_secret_access_key
The Secret in the release namespace, not in the Ozone one.
- Secret name (linha 4). The Secret in the release namespace, not in the Ozone one.
- 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.
- Secret key (linha 6). The Secret key that holds the secret key, received in AWS_SECRET_ACCESS_KEY.
Copy the Ozone Secret to the release namespace
The jobs only read Secrets from their own namespace.
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.
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
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.
Non-root user, read-only filesystem and a Role with no rules.
In a cluster security review, you need to know which permissions the jobs run with. The chart already defines restricted pods: non-root user, no privilege escalation, read-only root filesystem, no capabilities and the runtime default seccomp profile. The user directory and /tmp, where Spark writes, are temporary volumes of the pod itself. The identity of the pods is the chart ServiceAccount, with a Role with no rules: the jobs do not call the Kubernetes API.
podSecurityContext and securityContext: runAsNonRoot, allowPrivilegeEscalation: false, readOnlyRootFilesystem, capabilities.drop: [ALL] and seccomp RuntimeDefault.
ServiceAccount iceberg-maintenance, with the Role and RoleBinding <RELEASE_NAME>-tdp-iceberg-maintenance (or the release name followed by -maintenance when it already contains tdp-iceberg). rbac.rules is empty.
The identity of the job pod
- 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) - 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) - 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) - 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)
1serviceAccount:2create: true3name: "iceberg-maintenance"4annotations: {}56rbac:7create: true8rules: []910podSecurityContext:11runAsNonRoot: true12seccompProfile:13 type: RuntimeDefault1415securityContext:16allowPrivilegeEscalation: false17readOnlyRootFilesystem: true18runAsNonRoot: true19seccompProfile:20 type: RuntimeDefault21capabilities:22 drop:23 - ALL
Created by the chart for the job pods. The annotations are for your own integrations with the ServiceAccount.
- ServiceAccount (linha 1). Created by the chart for the job pods. The annotations are for your own integrations with the ServiceAccount.
- Role with no rules (linha 8). The jobs do not call the Kubernetes API. Add rules only for your own extensions.
- Pod (linha 10). The whole pod runs as a non-root user, with the runtime default seccomp profile.
- Read-only root (linha 17). The container does not write to the image. The user directory and Spark /tmp are temporary volumes of the pod.
- No capabilities (linha 21). All Linux capabilities are dropped from the container.
Check the identity and RBAC
The ServiceAccount, the Role and the RoleBinding are in the release namespace.
kubectl -n <NAMESPACE> get serviceaccount,role,rolebinding
It worked when
iceberg-maintenance appears, along with the release Role and RoleBinding, with the -maintenance suffix.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.
- 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).
- 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.
- 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
| Parameter | Description | Chart default |
|---|---|---|
maintenance.spark.s3Credentials.secretNameS3 keys | Secret with the S3 keys, in the release namespace | s3-credentials |
maintenance.spark.s3Credentials.accessKeyKeyS3 keys | Secret key that holds the access key | access-key |
maintenance.spark.s3Credentials.secretKeyKeyS3 keys | Secret key that holds the secret key | secret-key |
serviceAccount.createIdentity | Creates the ServiceAccount for the jobs | true |
serviceAccount.nameIdentity | Name of the ServiceAccount for the jobs | iceberg-maintenance |
serviceAccount.annotationsIdentity | ServiceAccount annotations | {} |
rbac.createIdentity | Creates the Role and RoleBinding for the jobs | true |
rbac.rulesIdentity | Role rules. The jobs do not call the Kubernetes API, only for your own extensions | [] |
podSecurityContext.runAsNonRootPods | Pod runs as a non-root user | true |
podSecurityContext.seccompProfile.typePods | Pod seccomp profile | RuntimeDefault |
securityContext.allowPrivilegeEscalationPods | Allows privilege escalation in the container | false |
securityContext.readOnlyRootFilesystemPods | Container root filesystem is read-only | true |
securityContext.runAsNonRootPods | Container runs as a non-root user | true |
securityContext.capabilities.dropPods | Linux capabilities dropped from the container | [ALL] |