Protected S3 keys
and defined permissions for the jobs.
Two scenarios: delivering the S3 storage keys to the jobs and the permissions each run uses. Each one covers: the chart default, what changes in the cluster, and the values file commented line by line.
Jobs from the chart tdp-deltalake read and write S3 storage using the access key and secret key from a Secret in the release namespace, and run with a dedicated ServiceAccount with no Kubernetes API permissions. For installation and jobs, see Delta Lake configuration.
Your environment
If you fill in your environment details here, the examples and commands on the page use what you entered. The namespace, release name and values file are your choices, not the chart's.
Scenarios
- 1 · S3 keys
- 2 · Pod identity
The default Secret, or the Secret Ozone creates with security enabled.
Maintenance jobs need an access key and secret key to read and write table files in S3. The chart does not store them in the values file: it reads both from a Secret in the release namespace and provides them to each run's pod. By default, this is an s3-credentials Secret you create. With Ozone security enabled, the S3 Gateway only accepts keys issued by Ozone itself, and jobs read the ozone-s3-credentials Secret.
Secret s3-credentials, with the keys access-key and secret-key, which you create before deployment in the release namespace.
Secret ozone-s3-credentials, with the keys aws_access_key_id and aws_secret_access_key. Ozone creates it only in its own namespace. With Delta Lake in another namespace, you copy it.
Where the jobs' S3 keys come from
Where the keys come from
- Pod for each run. Receives the access key and secret key from the Secret as environment variables, read when the pod starts. Spark uses them to access S3 through S3A. Chart default:
Secret s3-credentials. (maintenance.spark.s3Credentials) - S3 key Secret. Created by you before deployment in the release namespace, with the access-key and secret-key keys. With Ozone security disabled, any non-empty pair works. Chart default:
s3-credentials, with access-key and secret-key. (maintenance.spark.s3Credentials.secretName) - Ozone S3 Gateway. With Ozone security disabled, its default, accepts any key pair. Chart default:
Ozone security disabled.
Where the keys come from: s3-credentials Secret (default)
- Pod for each run. Receives the access key and secret key from the Secret as environment variables, read when the pod starts. Spark uses them to access S3 through S3A. Chart default:
Secret s3-credentials. (maintenance.spark.s3Credentials) - S3 key Secret. Created by you before deployment in the release namespace, with the access-key and secret-key keys. With Ozone security disabled, any non-empty pair works. Chart default:
s3-credentials, with access-key and secret-key. (maintenance.spark.s3Credentials.secretName) - Ozone S3 Gateway. With Ozone security disabled, its default, accepts any key pair. Chart default:
Ozone security disabled.
Where the keys come from: Ozone Secret (security enabled)
- Pod for each run. Receives the access key and secret key from the Secret as environment variables, read when the pod starts. Spark uses them to access S3 through S3A. Chart default:
Secret s3-credentials. (maintenance.spark.s3Credentials) - Ozone Secret. The keys Ozone issues with security enabled, stored under aws_access_key_id and aws_secret_access_key. Must be in the release namespace: when Ozone is in another namespace, this is a copy. Chart default:
s3-credentials, with access-key and secret-key. (maintenance.spark.s3Credentials.secretName) - Original Secret. Created by Ozone with security enabled, only in its namespace. For a release in another namespace, copy it, and copy it again after key rotation.
- Ozone S3 Gateway. With Ozone security enabled, only accepts keys issued by Ozone. Chart default:
Ozone security disabled.
Secret s3-credentials. With Ozone security disabled, its default, the S3 Gateway accepts any key pair, and any non-empty pair works here. Secret s3-credentials: Best suited when Ozone runs with security disabled.
The Secret name and key names are the chart defaults, so nothing needs to be added to the values file.
kubectl -n <NAMESPACE> create secret generic s3-credentials \
--from-literal=access-key='<ACCESS_KEY>' \
--from-literal=secret-key='<SECRET_KEY>'
1maintenance:2spark:3 s3Credentials:4 secretName: s3-credentials5 accessKeyKey: access-key6 secretKeyKey: secret-key
The Secret read by jobs in the release namespace.
- secretName (linha 4). The Secret read by jobs in the release namespace.
- accessKeyKey (linha 5). The Secret key containing the access key.
- secretKeyKey (linha 6). The Secret key containing the secret key.
Ozone Secret. With security enabled, Ozone creates the Secret ozone-s3-credentials with a key it issued itself, and the S3 Gateway validates it. Jobs reference that Secret and its key names. Ozone Secret: Best suited when Ozone runs with security enabled, because the S3 Gateway rejects a pair it did not issue.
The Secret must be in the release namespace. With Ozone in another namespace, copy it, and copy it again after key rotation.
1maintenance:2spark:3 s3Credentials:4 secretName: ozone-s3-credentials5 accessKeyKey: aws_access_key_id6 secretKeyKey: aws_secret_access_key
Created by Ozone with security enabled. Must exist in the release namespace.
- Ozone Secret (linha 4). Created by Ozone with security enabled. Must exist in the release namespace.
- access key (linha 5). The key name containing the access key in the Ozone Secret.
- secret key (linha 6). The key name containing the secret key in the Ozone Secret.
With Ozone in another namespace, copy the SecretOpcional
The Ozone Secret now also exists in the release namespace.
This step does not apply if you created the s3-credentials Secret above.
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)"
Here, <SHARED_NAMESPACE> is the Ozone namespace. For enabling Ozone security, see Security - Apache Ozone.
Apply to the release
Jobs now read keys from the specified Secret.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-deltalake \
--version 3.0.3 \
-n <NAMESPACE> \
-f <VALUES_FILE>
With the default Secret and no other changes, you can omit -f <VALUES_FILE>.
Success criteria
The release notes show the Secret and keys read by jobs. To verify without waiting for the schedule, run a job now, as described in Delta Lake configuration, and follow the log.
helm get notes <RELEASE_NAME> -n <NAMESPACE>
If the job pod does not start or S3 rejects the keys
CreateContainerConfigError means the Secret is missing or a key has a different name. S3 access denied with Ozone security enabled means the pair was not issued by Ozone. See When something goes wrong.
Key rotation. Each run's pod reads the keys when it starts: after changing the Secret, the next run of each job uses the new keys.
ServiceAccount, Role with no rules and pod security context.
This scenario shows the identity and permissions the job pods run with. The chart already defines everything, and nothing needs to be created manually: a dedicated ServiceAccount for the jobs, bound to a Role with no rules, because jobs do not call the Kubernetes API. Each pod runs as a non-root user with no privilege escalation or Linux capabilities.
Before approving the installation, you want to know the identity and permissions used by job pods.
ServiceAccount deltalake-maintenance, created by the chart (serviceAccount.create and serviceAccount.name).
Role and RoleBinding <RELEASE_NAME>-tdp-deltalake-maintenance (or <RELEASE_NAME>-maintenance when the release name already contains tdp-deltalake), with empty rbac.rules. Rules are only needed for your extensions.
Pod with runAsNonRoot and the seccomp profile RuntimeDefault. Container without privilege escalation, with all capabilities removed.
The identity of job pods
- Pod for each run. Runs as a non-root user with the RuntimeDefault seccomp profile, without privilege escalation or any Linux capabilities. Chart default:
The chart's podSecurityContext and securityContext. (podSecurityContext · securityContext) - ServiceAccount. Created by the chart and used by job pods. Chart default:
created, named deltalake-maintenance. (serviceAccount.create · serviceAccount.name) - Role and RoleBinding. Bind the ServiceAccount to a Role with no rules: jobs do not call the Kubernetes API. Rules are only needed for your extensions. Chart default:
created, with empty rules. (rbac.create · rbac.rules)
1serviceAccount:2create: true3name: "deltalake-maintenance"4annotations: {}56rbac:7create: true8rules: []910podSecurityContext:11runAsNonRoot: true12seccompProfile:13 type: RuntimeDefault1415securityContext:16allowPrivilegeEscalation: false17readOnlyRootFilesystem: false18runAsNonRoot: true19seccompProfile:20 type: RuntimeDefault21capabilities:22 drop:23 - ALL
The name of the ServiceAccount used by job pods.
- ServiceAccount (linha 3). The name of the ServiceAccount used by job pods.
- Annotations (linha 4). ServiceAccount annotations, empty by default.
- No rules (linha 8). Jobs do not call the Kubernetes API. Add rules only for your extensions.
- Pod (linha 10). Security context for each run's pod: non-root user and RuntimeDefault seccomp profile.
- Container (linha 15). No privilege escalation or Linux capabilities.
When something goes wrong
Troubleshooting
Paste the error message or choose a symptom. The response includes the cause, action and command.
- 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 by accessKeyKey and secretKeyKey. What to do: Create the Secret, or adjust the key names in the values file (scenario 1).
- ozone-s3-credentials does not exist in the Delta Lake namespace. Cause: Ozone creates the Secret only in its own namespace. What to do: Copy the Secret to the release namespace (scenario 1, Ozone Secret).
- S3 access denied with Ozone security enabled. Cause: With Ozone security enabled, the S3 Gateway only accepts keys issued by Ozone. Arbitrary pairs are rejected. What to do: Use the ozone-s3-credentials Secret (scenario 1, Ozone Secret). After rotation, copy the Secret again.
- Another problem. Cause: Start with the namespace events. What to do: Events in chronological order show what prevents the pod from starting.
All parameters
Keys are at the root of the values file.
13 of 13 parameters
| Parâmetro | Description | Chart default |
|---|---|---|
maintenance.spark.s3Credentials.secretNameS3 keys | Secret containing S3 keys in the release namespace | s3-credentials |
maintenance.spark.s3Credentials.accessKeyKeyS3 keys | Secret key containing the access key | access-key |
maintenance.spark.s3Credentials.secretKeyKeyS3 keys | Secret key containing the secret key | secret-key |
serviceAccount.createIdentity | Creates the ServiceAccount for jobs | true |
serviceAccount.nameIdentity | ServiceAccount name | deltalake-maintenance |
serviceAccount.annotationsIdentity | ServiceAccount annotations | {} |
rbac.createIdentity | Creates the Role and RoleBinding | true |
rbac.rulesIdentity | Role rules. Jobs do not call the Kubernetes API | [] |
podSecurityContext.runAsNonRootSecurity context | Pod running as a non-root user | true |
podSecurityContext.seccompProfile.typeSecurity context | Pod seccomp profile | RuntimeDefault |
securityContext.allowPrivilegeEscalationSecurity context | Container privilege escalation | false |
securityContext.readOnlyRootFilesystemSecurity context | Read-only root filesystem | false |
securityContext.capabilities.dropSecurity context | Removed Linux capabilities | [ALL] |
Next steps
Configuration
Delta Lake configuration
First steps, self-test, jobs, resources and the Spark subchart.