The catalog credentials,
always in Secrets.
Three scenarios: the database password in each PostgreSQL mode, the warehouse's S3 keys, and the restrictions under which the pods run. Each one covers: the chart default, where each credential comes from, and how to check it.
The tdp-hive-metastore chart never puts credentials in the ConfigMap, Deployment specification, process command line or logs. Hive configuration files only contain references to environment variables, and these variables come from Secrets: one for the database, always, and another for the S3 keys, when the warehouse is in Ozone.
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 · Initial credentials
- 2 · S3 keys
- 3 · Pod identity
Who creates the database Secret in each PostgreSQL mode, and how to change the temporary password.
The metastore reads the user, password and database name from the <RELEASE_NAME>-hive-database Secret, in the username, password and database keys. What changes between PostgreSQL modes is who creates this Secret: the chart, with the embedded database; the create-db Job, with the external database and database hooks enabled (Jobs that Helm runs before installation and before each upgrade); or you, with the external database without hooks. By default, the user is hive with a temporary password, the same default password as the TDP charts: set your own before using the metastore for anything beyond testing.
Embedded PostgreSQL, the hive user and the temporary password from postgres.password, written by the chart to the <RELEASE_NAME>-hive-database Secret.
With hooks, the password is generated and the one from postgres.password is not used. Without hooks, the database, user and Secret are yours.
The default is tag 4.0.0-3, published for amd64 and arm64.
Who creates the database Secret
Where the database runs
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With embedded PostgreSQL, the chart writes the Secret from postgres.database, postgres.username and postgres.password. (
tdp-hive-metastore.postgres.password) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The release's own PostgreSQL, at the <RELEASE_NAME>-postgres Service. (
tdp-hive-metastore.postgres.enabled)
Where the database runs: Embedded PostgreSQL (default)
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With embedded PostgreSQL, the chart writes the Secret from postgres.database, postgres.username and postgres.password. (
tdp-hive-metastore.postgres.password) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The release's own PostgreSQL, at the <RELEASE_NAME>-postgres Service. (
tdp-hive-metastore.postgres.enabled)
Where the database runs: External, with hooks
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With external PostgreSQL and hooks enabled, the Job creates the database and user with a generated password and writes the Secret. The postgres.password password is not used. (
TDP-Settings.externalDatabase.enabled: true) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Administrator password. The database Jobs read the PostgreSQL administrator password from the postgres-password key in this Secret, in the Hive Metastore namespace. Chart default:
tdp-postgresql-auth. (TDP-Settings.externalDatabase.externalSecret.releaseName) - Catalog database. The instance indicated in postgres.external.host. (
tdp-hive-metastore.postgres.enabled)
Where the database runs: External, without hooks
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With external PostgreSQL without hooks, the chart creates neither the database nor the Secret: both must exist before installation, or the metastore pod will not start. (
tdp-hive-metastore.postgres.enabled: false) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The instance indicated in postgres.external.host. (
tdp-hive-metastore.postgres.enabled)
Embedded PostgreSQL, the default. The chart writes the <RELEASE_NAME>-hive-database Secret from postgres.database, postgres.username and postgres.password. Embedded PostgreSQL: Best suited when the catalog database does not need to live in a shared PostgreSQL.
1tdp-hive-metastore:2postgres:3 enabled: true4 database: hive5 username: hive6 password: "<PASSWORD>"
The default. The chart writes the <RELEASE_NAME>-hive-database Secret from the next three lines.
- Embedded database (linha 3). The default. The chart writes the <RELEASE_NAME>-hive-database Secret from the next three lines.
- Database and user (linha 4). The database name and metastore user in embedded PostgreSQL.
- Password (linha 6). Replace the temporary password with your own. The chart does not put it in the ConfigMap: it reaches the pod through the Secret.
External, with hooks. Before installation, the create-db Job creates the database and the hive user in external PostgreSQL and writes the <RELEASE_NAME>-hive-database Secret, using the PostgreSQL administrator password. External, with hooks: Best suited when the environment is shared and already has a PostgreSQL, such as the one from tdp-postgresql: it is the recommended form.
1tdp-hive-metastore:2postgres:3 enabled: false45TDP-Settings:6externalDatabase:7 enabled: true8 recreate: false9 externalSecret:10 releaseName: "tdp-postgresql-auth"
With hooks enabled, the postgres.password password is not used: the create-db Job generates one.
- Embedded database disabled (linha 3). With hooks enabled, the postgres.password password is not used: the create-db Job generates one.
- Hooks (linha 7). Before installation and each upgrade, the Jobs check PostgreSQL, create the database and hive user with the generated password and write the <RELEASE_NAME>-hive-database Secret.
- recreate (linha 8). With true, the database and user are deleted and recreated on each deployment. Keep false to preserve data during upgrades.
- Administrator Secret (linha 10). Despite the key name, the value is the name of a Secret. The Jobs read the PostgreSQL administrator password from it, in the postgres-password key. In the tdp-postgresql chart, it is the Secret tdp-postgresql-auth.
The administrator Secret must exist in the Hive Metastore namespace: the Jobs read it in the release's own namespace. The complete external database configuration is in Integrations - Hive Metastore.
External, without hooks. Without TDP-Settings.externalDatabase.enabled: true, the chart creates neither the database nor the <RELEASE_NAME>-hive-database Secret, and the metastore pod cannot start. Before installing, create the metastore database and user in external PostgreSQL and, in the release namespace, the Secret with the three keys:
kubectl -n <NAMESPACE> create secret generic <RELEASE_NAME>-hive-database \
--from-literal=username=hive \
--from-literal=password='<PASSWORD>' \
--from-literal=database=hive
Apply to the release
The same command installs and upgrades.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-hive-metastore \
--version 3.0.3 -n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
Success when
kubectl -n <NAMESPACE> describe secret <RELEASE_NAME>-hive-database
The Secret has the username, password and database keys.
Check in the databaseOpcional
With the Secret's password, a temporary psql client reaches the metastore database.
HIVE_PASSWORD=$(kubectl get secret --namespace <NAMESPACE> <RELEASE_NAME>-hive-database -o jsonpath="{.data.password}" | base64 -d)
kubectl run hive-postgres-client --rm --tty -i --restart='Never' --namespace <NAMESPACE> \
--image registry.tecnisys.com.br/community/images/postgres:15 --env="PGPASSWORD=$HIVE_PASSWORD" \
--command -- psql -h <POSTGRESQL_SERVICE> -p 5432 -U hive -d hive
The host is <RELEASE_NAME>-postgres with the embedded database, or the external PostgreSQL host. In psql, check the schema version:
SELECT * FROM public."VERSION";
Success when
SCHEMA_VERSION is 4.0.0.If authentication fails
An authentication failure showing ${env.DB_PASSWORD} indicates that the environment variable is missing from the pod. See When something goes wrong.
The warehouse's S3 keys
The Ozone warehouse keys, in the values file or an existing Secret.
With the warehouse in Ozone (metastore.type: s3), the metastore needs an S3 key pair. The keys reach the pod as environment variables read from a Secret, through one of two paths: the chart writes the <RELEASE_NAME>-hive-s3 Secret from the keys you provide in the values file, or reads an existing Secret named in metastore.s3.existingSecret. These paths are mutually exclusive: with existingSecret set, the chart does not create its own.
No S3 keys: the warehouse is on the local volume (metastore.type: file).
With Ozone security enabled, the tdp-ozone chart creates the ozone-s3-credentials Secret, with the aws_access_key_id and aws_secret_access_key keys. With security disabled, the S3 Gateway accepts any non-empty key pair.
The S3 keys Secret
Where the keys come from
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With embedded PostgreSQL, the chart writes the Secret from postgres.database, postgres.username and postgres.password. (
tdp-hive-metastore.postgres.password) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The release's own PostgreSQL, at the <RELEASE_NAME>-postgres Service. (
tdp-hive-metastore.postgres.enabled)
Where the keys come from: From the values file
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With embedded PostgreSQL, the chart writes the Secret from postgres.database, postgres.username and postgres.password. (
tdp-hive-metastore.postgres.password) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The release's own PostgreSQL, at the <RELEASE_NAME>-postgres Service. (
tdp-hive-metastore.postgres.enabled) - S3 keys. Created by the chart from metastore.s3.accessKey and metastore.s3.secretKey, in the access-key and secret-key keys. (
tdp-hive-metastore.metastore.s3.existingSecret) - Warehouse in S3. Ozone's S3 Gateway, with the warehouse bucket. (
tdp-hive-metastore.metastore.type: s3)
Where the keys come from: From an existing Secret
- Metastore pod. The configuration files only contain ${env.DB_USER}, ${env.DB_PASSWORD}, ${env.S3_ACCESS_KEY} and ${env.S3_SECRET_KEY}. The values arrive as environment variables read from Secrets. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Who creates the database Secret. With embedded PostgreSQL, the chart writes the Secret from postgres.database, postgres.username and postgres.password. (
tdp-hive-metastore.postgres.password) - Database credentials. Keys username, password and database. The metastore reads the user, password and database from this Secret, in every database mode. Chart default:
created by the chart (embedded PostgreSQL). - Catalog database. The release's own PostgreSQL, at the <RELEASE_NAME>-postgres Service. (
tdp-hive-metastore.postgres.enabled) - S3 keys. A Secret created before installation, by you or another component, such as Ozone's ozone-s3-credentials with security enabled. The keys read are those from existingSecretAccessKeyKey and existingSecretSecretKeyKey. (
tdp-hive-metastore.metastore.s3.existingSecret) - Warehouse in S3. Ozone's S3 Gateway, with the warehouse bucket. (
tdp-hive-metastore.metastore.type: s3)
From the values file. The chart writes the <RELEASE_NAME>-hive-s3 Secret from metastore.s3.accessKey and metastore.s3.secretKey. From the values file: Best suited when no Secret with the keys exists yet.
1tdp-hive-metastore:2metastore:3 type: s34 s3:5 accessKey: "<S3_ACCESS_KEY>"6 secretKey: "<S3_SECRET_KEY>"
The chart only creates the keys Secret with type: s3. The rest of the warehouse configuration is in Integrations - Hive Metastore.
- Warehouse in S3 (linha 3). The chart only creates the keys Secret with type: s3. The rest of the warehouse configuration is in Integrations - Hive Metastore.
- Keys (linha 5). Written by the chart to the <RELEASE_NAME>-hive-s3 Secret, in the access-key and secret-key keys.
To avoid writing the keys in the file, pass them on the Helm command line:
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-hive-metastore \
--version 3.0.3 -n <NAMESPACE> -f <VALUES_FILE> \
--set tdp-hive-metastore.metastore.s3.accessKey='<S3_ACCESS_KEY>' \
--set tdp-hive-metastore.metastore.s3.secretKey='<S3_SECRET_KEY>'
From an existing Secret. The metastore reads the keys from the Secret named in metastore.s3.existingSecret, and the chart does not create its own. From an existing Secret: Best suited when the Secret with the keys already exists, such as the ozone-s3-credentials that the Ozone chart creates with security enabled.
Create the Secret before installation if you do not use ozone-s3-credentials:
kubectl -n <NAMESPACE> create secret generic s3-credentials \
--from-literal=access-key='<S3_ACCESS_KEY>' --from-literal=secret-key='<S3_SECRET_KEY>'
1tdp-hive-metastore:2metastore:3 type: s34 s3:5 existingSecret: s3-credentials6 existingSecretAccessKeyKey: access-key7 existingSecretSecretKeyKey: secret-key
The name of the Secret containing the keys. When set, the chart does not create <RELEASE_NAME>-hive-s3.
- Existing Secret (linha 5). The name of the Secret containing the keys. When set, the chart does not create <RELEASE_NAME>-hive-s3.
- Key names (linha 6). The Secret keys that store the access key and secret key.
With the Ozone Secret, when Ozone security is enabled:
1tdp-hive-metastore:2metastore:3 s3:4 existingSecret: ozone-s3-credentials5 existingSecretAccessKeyKey: aws_access_key_id6 existingSecretSecretKeyKey: aws_secret_access_key
Created by the Ozone chart with security enabled, with the key names from the following lines.
- Ozone Secret (linha 4). Created by the Ozone chart with security enabled, with the key names from the following lines.
Check the Secret read by the metastore
The metastore pod starts with the keys from the chosen Secret.
kubectl -n <NAMESPACE> get secret
kubectl -n <NAMESPACE> get pods
Success when
<RELEASE_NAME>-hive-s3 Secret (keys in the values file) or the Secret named in existingSecret exists, and the metastore pod is Running.The pull Secret and security contexts, on Kubernetes and OpenShift.
Before installing, you want to know the permissions under which the release pods run and where the images come from. The metastore and helper Jobs use the security contexts at the chart root: the RuntimeDefault seccomp profile (the container runtime's default filter for system calls), no privilege escalation and no capabilities (the Linux privileges that can be granted to a process separately from root). Embedded PostgreSQL has its own contexts, which change with the cluster platform: on standard Kubernetes, they make it run as the postgres user and give its group access to the volume. On OpenShift, the chart omits those two fields. Images come from the Tecnisys registry through the tdp-registry pull Secret, which you create in the namespace before installation.
The contexts of each pod
- Metastore pod. Uses the podSecurityContext and containerSecurityContext settings: RuntimeDefault seccomp profile, no privilege escalation and no capabilities. (
tdp-hive-metastore.podSecurityContext · tdp-hive-metastore.containerSecurityContext) - Pull Secret. Created by you in the release namespace, before installation, with your registry credentials. Chart default:
tdp-registry. (tdp-hive-metastore.imagePullSecrets) - Embedded PostgreSQL pod. Runs with the postgres user's uid, removing the need for initialization with chown and chmod as root when all capabilities are dropped. The fsGroup gives the postgres group access to the volume. (
tdp-hive-metastore.postgres.podSecurityContext · tdp-hive-metastore.postgres.containerSecurityContext)
1tdp-hive-metastore:2imagePullSecrets:3 - name: tdp-registry45podSecurityContext:6 seccompProfile:7 type: RuntimeDefault89containerSecurityContext:10 allowPrivilegeEscalation: false11 readOnlyRootFilesystem: false12 seccompProfile:13 type: RuntimeDefault14 capabilities:15 drop:16 - ALL1718postgres:19 podSecurityContext:20 fsGroup: 99921 seccompProfile:22 type: RuntimeDefault23 containerSecurityContext:24 runAsUser: 99925 runAsNonRoot: true26 allowPrivilegeEscalation: false27 readOnlyRootFilesystem: false28 seccompProfile:29 type: RuntimeDefault30 capabilities:31 drop:32 - ALL
The tdp-registry Secret must exist in the release namespace before installation.
- Pull Secret (linha 2). The tdp-registry Secret must exist in the release namespace before installation.
- Pod context (linha 5). Used by the metastore and helper Jobs.
- Container context (linha 9). No privilege escalation and no capabilities, with the RuntimeDefault seccomp profile.
- Embedded PostgreSQL (linha 18). The embedded PostgreSQL pod's own contexts.
- fsGroup (linha 20). On standard Kubernetes, gives the postgres group access to the data volume. On OpenShift, the chart omits this field.
- runAsUser (linha 24). On standard Kubernetes, the postgres user's uid: initialization does not need chown and chmod as root, required when all capabilities are dropped. On OpenShift, the chart omits this field.
On OpenShift, the chart omits fsGroup from the pod context and runAsUser from the embedded PostgreSQL container context. The other fields remain.
On standard Kubernetes, embedded PostgreSQL runs with the contexts above, including fsGroup and runAsUser.
Check the applied contexts
The release pods start with the chart's contexts.
kubectl -n <NAMESPACE> get pods
kubectl -n <NAMESPACE> get deployment <RELEASE_NAME>-metastore -o jsonpath='{.spec.template.spec.containers[0].securityContext}'
Success when
Running and the metastore container context shows allowPrivilegeEscalation: false and the RuntimeDefault seccomp profile.When something goes wrong
Troubleshooting
Paste the error message or choose the symptom. The answer comes with the cause, what to do and the command.
- ImagePullBackOff. Cause: The tdp-registry Secret is missing from the release namespace, or the registry credentials are wrong. What to do: Create the pull Secret in the namespace before installing (Hive Metastore Configuration, scenario 1).
- Authentication error with ${env.DB_PASSWORD}. Cause: The database environment variable is missing from the pod: the <RELEASE_NAME>-hive-database Secret is missing or lacks the username, password and database keys. What to do: Check the Secret. With external PostgreSQL without hooks, create it before installing (scenario 1).
- Database Jobs cannot read the administrator password. Cause: The Secret named in TDP-Settings.externalDatabase.externalSecret.releaseName does not exist in the Hive Metastore namespace, or lacks the postgres-password key. What to do: Create or copy the administrator Secret into the release namespace, with the postgres-password key.
- S3 access denied. Cause: Wrong S3 keys or a Secret with key names that differ from existingSecretAccessKeyKey and existingSecretSecretKeyKey. With Ozone security disabled, the S3 Gateway accepts any non-empty key pair. What to do: Check the keys Secret and key names (scenario 2).
- Another problem. Cause: Start with the metastore logs and namespace events. What to do: Also see When something goes wrong on the configuration page.
Best practices
- Replace the temporary database password before using the metastore for anything beyond testing.
- Pass S3 keys with
--setinstead of writing them in a versioned values file. - Keep
TDP-Settings.externalDatabase.recreate: falseduring upgrades to preserve the metastore database and user.
All parameters
The security parameters. Filter by name or group. Keys without a prefix are at the values file root.
19 of 19 parameters
| Parameter | Description | Chart default |
|---|---|---|
tdp-hive-metastore.postgres.databaseDatabase | Metastore database name | hive |
tdp-hive-metastore.postgres.usernameDatabase | Database user | hive |
tdp-hive-metastore.postgres.passwordDatabase | User password with embedded PostgreSQL (temporary). Not used with external database hooks | ChangeMe!T3c |
TDP-Settings.externalDatabase.enabledDatabase | Hooks that check external PostgreSQL, create the database and user and write the <RELEASE_NAME>-hive-database Secret | false |
TDP-Settings.externalDatabase.recreateDatabase | Deletes and recreates the database and user on each deployment | false |
TDP-Settings.externalDatabase.externalSecret.releaseNameDatabase | Name of the Secret containing the PostgreSQL administrator password (key postgres-password) | tdp-postgresql-auth |
tdp-hive-metastore.metastore.s3.accessKeyS3 | Access key written to the <RELEASE_NAME>-hive-s3 Secret | <S3_ACCESS_KEY> |
tdp-hive-metastore.metastore.s3.secretKeyS3 | Secret key written to the <RELEASE_NAME>-hive-s3 Secret | <S3_SECRET_KEY> |
tdp-hive-metastore.metastore.s3.existingSecretS3 | Existing Secret containing the S3 keys. When set, the chart does not create its own | "" |
tdp-hive-metastore.metastore.s3.existingSecretAccessKeyKeyS3 | Existing Secret key containing the access key | access-key |
tdp-hive-metastore.metastore.s3.existingSecretSecretKeyKeyS3 | Existing Secret key containing the secret key | secret-key |
tdp-hive-metastore.imagePullSecretsPods | Image pull Secrets | tdp-registry |
tdp-hive-metastore.podSecurityContext.seccompProfile.typePods | Metastore pod and Jobs seccomp profile | RuntimeDefault |
tdp-hive-metastore.containerSecurityContext.allowPrivilegeEscalationPods | Privilege escalation in containers | false |
tdp-hive-metastore.containerSecurityContext.readOnlyRootFilesystemPods | Read-only root filesystem | false |
tdp-hive-metastore.containerSecurityContext.capabilities.dropPods | Dropped capabilities | ALL |
tdp-hive-metastore.postgres.podSecurityContext.fsGroupPods | Group with access to the embedded PostgreSQL volume. Omitted on OpenShift | 999 |
tdp-hive-metastore.postgres.containerSecurityContext.runAsUserPods | Embedded PostgreSQL container user. Omitted on OpenShift | 999 |
tdp-hive-metastore.postgres.containerSecurityContext.runAsNonRootPods | Prevents the embedded PostgreSQL container from running as root | true |
For the complete parameter list, run helm show values for the installed chart version.
Next steps
Configuration
Hive Metastore Configuration
Installation, pool and JVM sizing, and the most common symptoms.
Integrations
Integrations - Hive Metastore
Shared PostgreSQL, warehouse in Ozone and catalog consumers.