PostgreSQL Configuration
The role of PostgreSQL in TDP
PostgreSQL is not a data analysis component — it is the platform's metadata infrastructure. Several TDP components require a relational database to store their own configurations, users, state, and history:
| Component | What it stores in PostgreSQL |
|---|---|
| Airflow | DAG definitions, runs, connections, variables |
| Hive Metastore | Schemas, tables, partitions, and S3 locations |
| Ranger | Access policies, users, groups, audit logs |
| CloudBeaver | Datasource and workspace configurations (optional) |
| Superset | Dashboards, users, database connections |
| JupyterHub | User sessions and configurations (optional) |
The tdp-postgresql chart deploys a shared PostgreSQL instance for all these components.
Each component creates its own database (isolated schema) within this instance.
Each TDP component can use the shared PostgreSQL (tdp-postgresql) or its own dedicated PostgreSQL. For production environments with high load, consider using dedicated instances for components such as Airflow and Hive Metastore. The TDPConfigurations.externalDatabase.* section on each component's page explains how to configure this.
This page summarizes the configuration of the tdp-postgresql chart in TDP Kubernetes. The chart publishes PostgreSQL for use by the platform.
Overview
| Property | Value |
|---|---|
| Chart | tdp-postgresql |
| PostgreSQL Version | 17.5.0 |
| Chart Version | 3.0.0 |
| Registry (OCI) | oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql |
Installation (OCI)
helm install <release> oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql -n <namespace> --create-namespace
Main parameters
| Parameter | Description | Default |
|---|---|---|
tdp-postgresql.postgresql.enabled | Enable PostgreSQL subchart | true |
tdp-postgresql.primary.persistence.enabled | Enable persistence | true |
tdp-postgresql.primary.persistence.size | PVC size | 1Gi |
tdp-postgresql.primary.resources.requests.cpu | CPU request | 500m |
tdp-postgresql.primary.resources.requests.memory | Memory request | 1Gi |
tdp-postgresql.primary.resources.limits.cpu | CPU limit | 1000m |
tdp-postgresql.primary.resources.limits.memory | Memory limit | 2Gi |
tdp-postgresql.primary.configuration | postgresql.conf overrides | "" |
tdp-postgresql.service.type | Service type | ClusterIP |
tdp-postgresql.service.port | Service port | 5432 |
tdp-postgresql.metrics.enabled | Metrics exporter | false |
For the full list, run helm show values oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql (or the registry you use) on the installed version.
postgresql.conf overrides
The chart accepts custom configuration via tdp-postgresql.primary.configuration. Example:
tdp-postgresql:
primary:
configuration: |-
listen_addresses = '*'
max_connections = 400
superuser_reserved_connections = 10
wal_level = 'replica'
fsync = 'on'
max_wal_size = '400MB'
max_wal_senders = '16'
wal_keep_size = '128MB'
hot_standby = 'on'
log_connections = 'false'
log_disconnections = 'false'
log_hostname = 'false'
client_min_messages = 'error'
To revert to the subchart's default behavior for this block, use configuration: "" or omit the section, depending on your needs.
Access
In-cluster DNS: <release>.<namespace>.svc.cluster.local:5432
Retrieve the password
export POSTGRES_PASSWORD=$(kubectl get secret --namespace <namespace> <release> \
-o jsonpath="{.data['postgres-password']}" | base64 -d)
Connect from a temporary pod
kubectl run <release>-client --rm --tty -i --restart='Never' --namespace <namespace> \
--image docker.io/bitnamilegacy/postgresql:17.5.0-debian-12-r20 \
--env="PGPASSWORD=$POSTGRES_PASSWORD" \
--command -- psql -h <release> -p 5432 -U postgres -d postgres
Port-forward (outside the cluster)
kubectl port-forward --namespace <namespace> svc/<release> 5432:5432
psql -h 127.0.0.1 -p 5432 -U postgres -d postgres
Troubleshooting
kubectl -n <namespace> get pods
kubectl -n <namespace> get svc
kubectl -n <namespace> get pvc
kubectl -n <namespace> get events --sort-by=.lastTimestamp
Uninstallation
helm uninstall <release> -n <namespace>