Skip to main content
Version 3.0

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.

ChartVersion3.0.3TypeapplicationAppVersion4.0.0
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+
Feature SupportS3supportedExternal DBsupported

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​

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.

Chart default

Embedded PostgreSQL, the hive user and the temporary password from postgres.password, written by the chart to the <RELEASE_NAME>-hive-database Secret.

External database

With hooks, the password is generated and the one from postgres.password is not used. Without hooks, the database, user and Secret are yours.

From 3.0.2 on, postgres.existingSecretPasswordKey no longer exists: the database password comes from the <RELEASE_NAME>-hive-database Secret, in the password key.
From 3.0.2 on, The chart now requires the hive-metastore image at tag 4.0.0-2 or later: older images pass credentials on the command line and, with external PostgreSQL, are incompatible with the chart.

The default is tag 4.0.0-3, published for amd64 and arm64.

Who creates the database Secret

Where the database runs

Your choice changes the commands and passages below.

createsJDBCHive MetastoreDB_* and S3_* variablesthe chartfrom postgres.*Secret<RELEASE_NAME>-hive-databaseEmbedded PostgreSQLhive user and database
  1. 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)
  2. 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)
  3. 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).
  4. 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)

createsJDBCHive MetastoreDB_* and S3_* variablesthe chartfrom postgres.*Secret<RELEASE_NAME>-hive-databaseEmbedded PostgreSQLhive user and database
  1. 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)
  2. 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)
  3. 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).
  4. 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

createsJDBCHive MetastoreDB_* and S3_* variablesJob create-dbgenerated passwordSecret<RELEASE_NAME>-hive-databaseAdmin Secrettdp-postgresql-authExternal PostgreSQLhive user and database
  1. 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)
  2. 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)
  3. 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).
  4. 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)
  5. Catalog database. The instance indicated in postgres.external.host. (tdp-hive-metastore.postgres.enabled)

Where the database runs: External, without hooks

createsJDBCHive MetastoreDB_* and S3_* variablesyoubefore installingSecret<RELEASE_NAME>-hive-databaseExternal PostgreSQLhive user and database
  1. 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)
  2. 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)
  3. 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).
  4. Catalog database. The instance indicated in postgres.external.host. (tdp-hive-metastore.postgres.enabled)
Switch above to see who creates the database Secret in each mode. Click the elements.

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.

Click the markers to understand each line. The password stays as a placeholder that you replace in your file.

1tdp-hive-metastore:
2postgres:
3 enabled: true
4 database: hive
5 username: hive
6 password: "<PASSWORD>"

The default. The chart writes the <RELEASE_NAME>-hive-database Secret from the next three lines.

  1. Embedded database (linha 3). The default. The chart writes the <RELEASE_NAME>-hive-database Secret from the next three lines.
  2. Database and user (linha 4). The database name and metastore user in embedded PostgreSQL.
  3. 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.
Embedded PostgreSQL: your password

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.

The complete external database file is in Integrations - Hive Metastore. Here, only the credential settings.

1tdp-hive-metastore:
2postgres:
3 enabled: false
4
5TDP-Settings:
6externalDatabase:
7 enabled: true
8 recreate: false
9 externalSecret:
10 releaseName: "tdp-postgresql-auth"

With hooks enabled, the postgres.password password is not used: the create-db Job generates one.

  1. Embedded database disabled (linha 3). With hooks enabled, the postgres.password password is not used: the create-db Job generates one.
  2. 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.
  3. recreate (linha 8). With true, the database and user are deleted and recreated on each deployment. Keep false to preserve data during upgrades.
  4. 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.
External database with hooks: the administrator Secret

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:

Terminal input
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.

Terminal input
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

Terminal input
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.

Terminal input
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:

psql
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.

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.

  1. 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).
  2. 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).
  3. 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.
  4. 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).
  5. 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 --set instead of writing them in a versioned values file.
  • Keep TDP-Settings.externalDatabase.recreate: false during 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

ParameterDescriptionChart default
tdp-hive-metastore.postgres.databaseDatabaseMetastore database namehive
tdp-hive-metastore.postgres.usernameDatabaseDatabase userhive
tdp-hive-metastore.postgres.passwordDatabaseUser password with embedded PostgreSQL (temporary). Not used with external database hooksChangeMe!T3c
TDP-Settings.externalDatabase.enabledDatabaseHooks that check external PostgreSQL, create the database and user and write the <RELEASE_NAME>-hive-database Secretfalse
TDP-Settings.externalDatabase.recreateDatabaseDeletes and recreates the database and user on each deploymentfalse
TDP-Settings.externalDatabase.externalSecret.releaseNameDatabaseName of the Secret containing the PostgreSQL administrator password (key postgres-password)tdp-postgresql-auth
tdp-hive-metastore.metastore.s3.accessKeyS3Access key written to the <RELEASE_NAME>-hive-s3 Secret<S3_ACCESS_KEY>
tdp-hive-metastore.metastore.s3.secretKeyS3Secret key written to the <RELEASE_NAME>-hive-s3 Secret<S3_SECRET_KEY>
tdp-hive-metastore.metastore.s3.existingSecretS3Existing Secret containing the S3 keys. When set, the chart does not create its own""
tdp-hive-metastore.metastore.s3.existingSecretAccessKeyKeyS3Existing Secret key containing the access keyaccess-key
tdp-hive-metastore.metastore.s3.existingSecretSecretKeyKeyS3Existing Secret key containing the secret keysecret-key
tdp-hive-metastore.imagePullSecretsPodsImage pull Secretstdp-registry
tdp-hive-metastore.podSecurityContext.seccompProfile.typePodsMetastore pod and Jobs seccomp profileRuntimeDefault
tdp-hive-metastore.containerSecurityContext.allowPrivilegeEscalationPodsPrivilege escalation in containersfalse
tdp-hive-metastore.containerSecurityContext.readOnlyRootFilesystemPodsRead-only root filesystemfalse
tdp-hive-metastore.containerSecurityContext.capabilities.dropPodsDropped capabilitiesALL
tdp-hive-metastore.postgres.podSecurityContext.fsGroupPodsGroup with access to the embedded PostgreSQL volume. Omitted on OpenShift999
tdp-hive-metastore.postgres.containerSecurityContext.runAsUserPodsEmbedded PostgreSQL container user. Omitted on OpenShift999
tdp-hive-metastore.postgres.containerSecurityContext.runAsNonRootPodsPrevents the embedded PostgreSQL container from running as roottrue

For the complete parameter list, run helm show values for the installed chart version.

Next steps​