One PostgreSQL
for the components' metadata.
Four scenarios: how the other charts access this PostgreSQL, the connection with the Hive Metastore, the connection with the other components, and the use of a PostgreSQL from another namespace. Each one covers: what changes, where each setting goes, and the verification.
The tdp-postgresql chart offers the other components an internal address and an admin password. The connection is configured in the chart of each component: it receives this address and the name of the password Secret, and a Job of its own chart creates the component's database and user in it.
Your environment
If you fill in your environment details here, the examples and commands on the page use what you provided. The namespace, the release name and the values file are your choices, not the chart's.
Scenarios
- 1 · How it is accessed
- 2 · Hive Metastore
- 3 · The other components
- 4 · Another namespace
The address, the admin password and what each component does with them.
The other components access PostgreSQL through the address of the Service, with the admin password of the postgres user, in the tdp-postgresql-auth Secret. Each component receives these two in its own values file. A Job of the component chart uses the admin password to create the component's database and user, and the component then uses that user.
By default, no component is connected: the internal Service and the admin Secret exist from the installation, and in this chart nothing changes except the connection limit.
The following tabs connect each component: the Hive Metastore in scenario 2, Airflow, Ranger, Superset, JupyterHub, OpenMetadata, CloudBeaver and Trino in scenario 3, and a component in another namespace in scenario 4.
No component connected. The internal Service (ClusterIP) and the admin Secret exist from the installation.
The address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port, and the name of the tdp-postgresql-auth Secret, with the password in the postgres-password key.
Applies to all components of the instance together. Adjust it before connecting the Hive Metastore and the others, as in scenario 3 of PostgreSQL Configuration.
The components that can use this PostgreSQL
- Hive Metastore. Address in postgres.external.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-hive-metastore.postgres.external.host) - Airflow. Address in the database connection block in data. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-airflow.data) - Ranger. Address in ranger.database.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-ranger.ranger.database.host) - Superset. Address in supersetNode.connections.db_host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-superset.supersetNode.connections.db_host) - JupyterHub. Address in the hub.db.url URL. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-jupyter.hub.db.url) - OpenMetadata. Address through the releaseName and the namespace (or host) of global.TDP-Settings.database.postgresql. Admin Secret in secretName, in the same block. (
global.TDP-Settings.database.postgresql) - CloudBeaver. Address in database.host. Admin Secret in database.postgresSecret.name. (
tdp-cloudbeaver.database.postgresSecret.name) - Trino. Queries the data of a database through the postgresql catalog, with the JDBC address and the user of that database. It does not use the admin Secret. (
tdp-trino.catalogs) - PostgreSQL address. <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port. The Service name is <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. (
tdp-postgresql.service.port) - PostgreSQL. Each connected component has its own database and its own user here, created by the database Job of its chart. The connection limit applies to all of them together. (
tdp-postgresql.primary.extendedConfiguration) - Admin password. The password of the postgres user, in the postgres-password key. The database Jobs of the components use it to create the database and the user of each one, and read it in the namespace of the component itself. Chart default:
tdp-postgresql-auth, key postgres-password. (tdp-postgresql.auth.existingSecret)
Check the address and the Secret
The two values you will take to the component values file.
kubectl -n <NAMESPACE> get svc
kubectl -n <NAMESPACE> get secret tdp-postgresql-auth
It worked when
<POSTGRESQL_SERVICE> Service appears as ClusterIP and the Secret exists. The Service name comes from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql.Any other PostgreSQL client running in the cluster reaches the database through the same address.
The component that asks for the most connections: what to adjust here and what to configure in Hive.
You are going to keep the Hive Metastore catalog in this PostgreSQL. The Hive Metastore alone needs hundreds of connections, and the PostgreSQL default limit is not enough. That is why the connection has two parts, in this order: raise the connection limit in this chart and then configure the external database in the Hive Metastore chart.
The max_connections in primary.extendedConfiguration, applied before installing the Hive Metastore.
The embedded PostgreSQL turned off, the address of this Service, the database hooks turned on and the tdp-postgresql-auth Secret in the Hive Metastore namespace.
The Hive Metastore on PostgreSQL
- Hive Metastore. Address in postgres.external.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-hive-metastore.postgres.external.host) - Airflow. Address in the database connection block in data. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-airflow.data) - Ranger. Address in ranger.database.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-ranger.ranger.database.host) - Superset. Address in supersetNode.connections.db_host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-superset.supersetNode.connections.db_host) - JupyterHub. Address in the hub.db.url URL. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-jupyter.hub.db.url) - OpenMetadata. Address through the releaseName and the namespace (or host) of global.TDP-Settings.database.postgresql. Admin Secret in secretName, in the same block. (
global.TDP-Settings.database.postgresql) - CloudBeaver. Address in database.host. Admin Secret in database.postgresSecret.name. (
tdp-cloudbeaver.database.postgresSecret.name) - Trino. Queries the data of a database through the postgresql catalog, with the JDBC address and the user of that database. It does not use the admin Secret. (
tdp-trino.catalogs) - PostgreSQL address. <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port. The Service name is <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. (
tdp-postgresql.service.port) - PostgreSQL. Each connected component has its own database and its own user here, created by the database Job of its chart. The connection limit applies to all of them together. (
tdp-postgresql.primary.extendedConfiguration) - Admin password. The password of the postgres user, in the postgres-password key. The database Jobs of the components use it to create the database and the user of each one, and read it in the namespace of the component itself. Chart default:
tdp-postgresql-auth, key postgres-password. (tdp-postgresql.auth.existingSecret)
- Raise the connection limit: scenario 3 of PostgreSQL Configuration, with the check through
SHOW max_connections;. - Configure the external database in the Hive Metastore: the Shared PostgreSQL scenario of Integrations - Hive Metastore.
Airflow, Ranger, Superset, JupyterHub, OpenMetadata, CloudBeaver and Trino: where each setting goes.
You want Airflow, Ranger, Superset, JupyterHub, OpenMetadata or CloudBeaver to keep their metadata in this PostgreSQL, or you want to query the data of one of its databases through Trino. In the components that keep metadata, the embedded database is turned off and the address of this PostgreSQL goes into the values file, along with the name of the admin Secret. In Trino, the address goes into the postgresql catalog, with the user of the queried database. The table shows where each setting goes. The full procedure, with the check, is on the page of each component.
Nothing, besides the connection limit for all the clients of the instance.
The address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local and the admin Secret, in the keys of the table below.
The other components on PostgreSQL
- Hive Metastore. Address in postgres.external.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-hive-metastore.postgres.external.host) - Airflow. Address in the database connection block in data. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-airflow.data) - Ranger. Address in ranger.database.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-ranger.ranger.database.host) - Superset. Address in supersetNode.connections.db_host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-superset.supersetNode.connections.db_host) - JupyterHub. Address in the hub.db.url URL. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-jupyter.hub.db.url) - OpenMetadata. Address through the releaseName and the namespace (or host) of global.TDP-Settings.database.postgresql. Admin Secret in secretName, in the same block. (
global.TDP-Settings.database.postgresql) - CloudBeaver. Address in database.host. Admin Secret in database.postgresSecret.name. (
tdp-cloudbeaver.database.postgresSecret.name) - Trino. Queries the data of a database through the postgresql catalog, with the JDBC address and the user of that database. It does not use the admin Secret. (
tdp-trino.catalogs) - PostgreSQL address. <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port. The Service name is <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. (
tdp-postgresql.service.port) - PostgreSQL. Each connected component has its own database and its own user here, created by the database Job of its chart. The connection limit applies to all of them together. (
tdp-postgresql.primary.extendedConfiguration) - Admin password. The password of the postgres user, in the postgres-password key. The database Jobs of the components use it to create the database and the user of each one, and read it in the namespace of the component itself. Chart default:
tdp-postgresql-auth, key postgres-password. (tdp-postgresql.auth.existingSecret)
Where each setting goes
| Component | PostgreSQL address | Admin Secret | Page |
|---|---|---|---|
| Airflow | tdp-airflow.data (metadata database connection) | TDP-Settings.externalDatabase.externalSecret.releaseName | Airflow Configuration |
| Ranger | tdp-ranger.ranger.database.host | TDP-Settings.externalDatabase.externalSecret.releaseName | Ranger Configuration |
| Superset | tdp-superset.supersetNode.connections.db_host | TDP-Settings.externalDatabase.externalSecret.releaseName | Superset Configuration |
| JupyterHub | tdp-jupyter.hub.db.url | TDP-Settings.externalDatabase.externalSecret.releaseName | Jupyter Configuration |
| OpenMetadata | global.TDP-Settings.database.postgresql.releaseName and namespace (or host) | global.TDP-Settings.database.postgresql.secretName | OpenMetadata Configuration |
| CloudBeaver | tdp-cloudbeaver.database.host | tdp-cloudbeaver.database.postgresSecret.name | CloudBeaver Configuration |
| Trino | connection-url of the postgresql catalog, in tdp-trino.catalogs | not used: the catalog carries the user of the queried database | Integrations - Trino |
In Airflow, Ranger, Superset, JupyterHub and OpenMetadata, the default name of the admin Secret is already tdp-postgresql-auth. In CloudBeaver, the default is empty and the name must be provided. In Airflow, Ranger, Superset and JupyterHub, keep TDP-Settings.externalDatabase.recreate: false: with true, the Job drops and recreates the component's database and user on every install and upgrade.
The address with the namespace and the copy of the password to the component namespace.
PostgreSQL runs in one namespace and the component that will use it, in another. Two things change. The address now carries the PostgreSQL namespace, as in all the examples on this page. And the component database Job reads the admin Secret in the component's own namespace: the password must be copied there before installing the component.
The tdp-postgresql-auth Secret exists only in the PostgreSQL namespace.
The component namespace created.
The admin password in another namespace
- Hive Metastore. Address in postgres.external.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-hive-metastore.postgres.external.host) - Airflow. Address in the database connection block in data. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-airflow.data) - Ranger. Address in ranger.database.host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-ranger.ranger.database.host) - Superset. Address in supersetNode.connections.db_host. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-superset.supersetNode.connections.db_host) - JupyterHub. Address in the hub.db.url URL. Admin Secret in TDP-Settings.externalDatabase.externalSecret.releaseName. (
tdp-jupyter.hub.db.url) - OpenMetadata. Address through the releaseName and the namespace (or host) of global.TDP-Settings.database.postgresql. Admin Secret in secretName, in the same block. (
global.TDP-Settings.database.postgresql) - CloudBeaver. Address in database.host. Admin Secret in database.postgresSecret.name. (
tdp-cloudbeaver.database.postgresSecret.name) - Trino. Queries the data of a database through the postgresql catalog, with the JDBC address and the user of that database. It does not use the admin Secret. (
tdp-trino.catalogs) - PostgreSQL address. <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port. The Service name is <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. (
tdp-postgresql.service.port) - PostgreSQL. Each connected component has its own database and its own user here, created by the database Job of its chart. The connection limit applies to all of them together. (
tdp-postgresql.primary.extendedConfiguration) - Admin password. The password of the postgres user, in the postgres-password key. The database Jobs of the components use it to create the database and the user of each one, and read it in the namespace of the component itself. Chart default:
tdp-postgresql-auth, key postgres-password. (tdp-postgresql.auth.existingSecret) - Copy in the component namespace. The component database Job reads the Secret in the component own namespace. With PostgreSQL in another namespace, the password is copied there before installing the component. (
tdp-postgresql-auth)
Copy the password to the component namespace
The component database Job finds the Secret in its own namespace.
kubectl -n <DEDICATED_NAMESPACE> create secret generic tdp-postgresql-auth \
--from-literal=postgres-password="$(kubectl -n <NAMESPACE> get secret tdp-postgresql-auth \
-o jsonpath='{.data.postgres-password}' | base64 -d)"
It worked when
kubectl -n <DEDICATED_NAMESPACE> get secret tdp-postgresql-auth
The Secret exists in the component namespace, with the postgres-password key.
Use the address with the PostgreSQL namespace
The component reaches the Service in another namespace through the full name.
In the component values file, the address is <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, with the PostgreSQL namespace, in the keys of the table in scenario 3. In OpenMetadata, the PostgreSQL namespace goes in global.TDP-Settings.database.postgresql.namespace.
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.
- The component cannot find the admin Secret. Cause: The database Job of the component reads the tdp-postgresql-auth Secret in the component own namespace, and it does not exist there: PostgreSQL is in another namespace or has not been installed yet. What to do: Install PostgreSQL before the component or copy the Secret to the component namespace (scenario 4).
- Component Job fails with connection refused. Cause: Wrong Service name or namespace in the address configured in the component. What to do: Check the name of the PostgreSQL Service and the namespace in the address (scenario 1).
- Connections exhausted with several components. Cause: The PostgreSQL connection limit does not accommodate the Hive Metastore and the other clients of the same instance. What to do: Raise max_connections before installing the components (PostgreSQL Configuration, scenario 3).
Next steps
PostgreSQL
PostgreSQL Configuration
Installation, connecting with psql, connection limit, disk and memory.
Hive Metastore
Integrations - Hive Metastore
The Hive catalog in this PostgreSQL, with the database hooks.