Skip to main content
Version Next

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:

ComponentWhat it stores in PostgreSQL
AirflowDAG definitions, runs, connections, variables
Hive MetastoreSchemas, tables, partitions, and S3 locations
RangerAccess policies, users, groups, audit logs
CloudBeaverDatasource and workspace configurations (optional)
SupersetDashboards, users, database connections
JupyterHubUser 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.

Internal vs. external PostgreSQL

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

PropertyValue
Charttdp-postgresql
PostgreSQL Version17.5.0
Chart Version3.0.0
Registry (OCI)oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql

Installation (OCI)

Terminal input
helm install <release> oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql -n <namespace> --create-namespace

Main parameters

ParameterDescriptionDefault
tdp-postgresql.postgresql.enabledEnable PostgreSQL subcharttrue
tdp-postgresql.primary.persistence.enabledEnable persistencetrue
tdp-postgresql.primary.persistence.sizePVC size1Gi
tdp-postgresql.primary.resources.requests.cpuCPU request500m
tdp-postgresql.primary.resources.requests.memoryMemory request1Gi
tdp-postgresql.primary.resources.limits.cpuCPU limit1000m
tdp-postgresql.primary.resources.limits.memoryMemory limit2Gi
tdp-postgresql.primary.configurationpostgresql.conf overrides""
tdp-postgresql.service.typeService typeClusterIP
tdp-postgresql.service.portService port5432
tdp-postgresql.metrics.enabledMetrics exporterfalse

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

Terminal input
export POSTGRES_PASSWORD=$(kubectl get secret --namespace <namespace> <release> \
-o jsonpath="{.data['postgres-password']}" | base64 -d)

Connect from a temporary pod

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

Terminal input
kubectl port-forward --namespace <namespace> svc/<release> 5432:5432
psql -h 127.0.0.1 -p 5432 -U postgres -d postgres

Troubleshooting

Terminal input
kubectl -n <namespace> get pods
kubectl -n <namespace> get svc
kubectl -n <namespace> get pvc
kubectl -n <namespace> get events --sort-by=.lastTimestamp

Uninstallation

Terminal input
helm uninstall <release> -n <namespace>