The PostgreSQL that stores
the platform's metadata.
Five common scenarios, from the first installation to the database shared by the components. Each one covers: what the chart already provides, the values file commented line by line, and a step-by-step with verification.
The tdp-postgresql chart brings up in the namespace a PostgreSQL with a single primary instance, a persistent volume, and an administration password generated on the first installation. Other TDP components, such as Hive Metastore, Airflow, and Ranger, can store their own metadata databases in it.
Your environment
If you fill in your environment details here, the examples and commands on the page use what you entered. The namespace, the release name, and the values file are your choices, not the chart's.
Scenarios
- 1 · First contact
- 2 · Connect with psql
- 3 · Connections and postgresql.conf
- 4 · Disk and memory
- 5 · Serve as the database
Install with the chart defaults, choose the password or let it be generated, and check what came up.
You are going to install the PostgreSQL that other TDP components will use and want to see it working before deciding on size or configuration. What comes up is a primary PostgreSQL instance, with a data volume and an internal Service. The password of the postgres superuser is generated on the first installation and stored in a Secret. If you prefer to choose the password, create that Secret before installing. The same installation command works on standard Kubernetes and on OpenShift.
A single primary PostgreSQL instance in a StatefulSet, with no read replicas.
Superuser postgres. On the first installation, a Job generates a random 16-character password and writes it to the Secret tdp-postgresql-auth, in the postgres-password key. Updates and GitOps syncs reuse the Secret: the password does not change.
Persistent volume with the size from primary.persistence.size, in the cluster default StorageClass. Requests and limits in primary.resources (values in All parameters).
Internal Service (ClusterIP) on the service.port port, for whoever runs inside the cluster.
Compatible with OpenShift without an additional --set: global.compatibility.openshift.adaptSecurityContext: auto and volumePermissions.enabled: false. On standard Kubernetes, writing to the volume depends on the permissions of the StorageClass and the PersistentVolume.
What comes up in the namespace with the chart defaults
- Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
- Job that creates the administration Secret. Before the installation and before each update, it checks whether the administration Secret exists. If it does not, it generates a random password and creates the Secret. If it does, it changes nothing. The Job is removed when it finishes successfully. Chart default:
on. (tdp-postgresql.auth.existingSecret) - Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. No overrides: the PostgreSQL default configuration applies, including the default connection limit. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
Check the TDP license
The chart requires a valid TDP license installed in the cluster.
kubectl get platformlicenses -A
It worked when
tdp-license chart before continuing, as in Licensing Configuration.Create the pull Secret in the namespace
The chart uses the tdp-registry Secret, with your TDP registry credentials, in the release namespace.
kubectl -n <NAMESPACE> create secret docker-registry tdp-registry \
--docker-server=registry.tecnisys.com.br \
--docker-username=<REGISTRY_USERNAME> --docker-password=<REGISTRY_CLI_SECRET>
The user and the token are your registry ones. How to obtain them is in Prerequisites. The Secret must exist in the namespace before the installation: if the namespace does not exist, create it before the Secret, with kubectl create namespace <NAMESPACE>.
It worked when
kubectl -n <NAMESPACE> get secret tdp-registry
Choose the password, if you wantOpcional
Without this step, the password is generated on installation.
To choose the password of the postgres user, create the Secret before the first installation. After it, the chart reuses the Secret it finds.
kubectl -n <NAMESPACE> create secret generic tdp-postgresql-auth \
--from-literal=postgres-password='<PASSWORD>'
Replace <PASSWORD> with the password. It stays only in the command, never in the values file.
Install the chart
Without a values file, the chart comes up exactly as in the figure above.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace
Without --version, Helm installs the latest published version of the chart. With your own settings, create your values file and add -f <VALUES_FILE> (see Values files).
It worked when
kubectl -n <NAMESPACE> get pods
The pod <POSTGRESQL_SERVICE>-0 reaches Running. The Service name comes from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql (the release tdp-postgresql produces the Service tdp-postgresql). The Helm NOTES, at the end of the installation, show the exact name.
If the installation is refused or the pod does not start
A refusal with license check failed is the license; ImagePullBackOff is the pull Secret; a pod or PVC in Pending is the StorageClass. All three are in When something goes wrong.
Check the Service, the volume, and the Secret
The three objects that the other components will use.
kubectl -n <NAMESPACE> get svc
kubectl -n <NAMESPACE> get pvc
kubectl -n <NAMESPACE> get secret tdp-postgresql-auth
It worked when
<POSTGRESQL_SERVICE> appears as ClusterIP, the PVC data-<POSTGRESQL_SERVICE>-0 is Bound, and the Secret tdp-postgresql-auth exists. To open a session, see scenario 2.Read the administration password and open a session, from inside the cluster or from your machine.
PostgreSQL is up and you want to open a session as postgres: to check a database created by another component, see a setting, or diagnose a connection. The simplest path is a temporary client pod in the namespace, with psql already installed. You do not need a PostgreSQL client on your machine. For one-off administration from your machine, port-forward opens a tunnel to the Service.
Internal Service (ClusterIP), with no external exposure. Address inside the cluster: <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
The Service name, which appears in the Helm NOTES (scenario 1).
The client pod is temporary and deletes itself at the end of the session (--rm). The port-forward is the same in both choices.
With the restricted Pod Security profile, the client pod starts with a restricted securityContext and keeps running: the session opens with kubectl exec and, at the end, you remove the pod. The port-forward is the same in both choices.
The two paths to PostgreSQL
- One-off access from outside the cluster. kubectl connects a port on your machine to the Service port while the command is running. It serves for one-off administration and diagnostics, with the psql client installed on your machine.
- Client pod with psql. A temporary pod with the PostgreSQL client image, in the same namespace. It opens psql and deletes itself when the session ends. Chart default:
client image in client.image. (tdp-postgresql.client.image) - Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. No overrides: the PostgreSQL default configuration applies, including the default connection limit. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
Read the administration password
The password of the postgres user is in the chart Secret.
export POSTGRES_PASSWORD=$(kubectl get secret --namespace <NAMESPACE> tdp-postgresql-auth \
-o jsonpath="{.data['postgres-password']}" | base64 -d)
Treat this Secret as an administrative credential: whoever reads it administers PostgreSQL and the databases of all the components that are in it.
Connect through a client pod
A psql session from inside the namespace, without installing anything on your machine.
The pod deletes itself when the session ends (--rm):
kubectl run <RELEASE_NAME>-client --rm --tty -i --restart='Never' --namespace <NAMESPACE> \
--image registry.tecnisys.com.br/community/images/bitnamilegacy/postgresql:17.5.0-debian-12-r20 \
--env="PGPASSWORD=$POSTGRES_PASSWORD" \
--command -- psql -h <POSTGRESQL_SERVICE> -p 5432 -U postgres -d postgres
With the restricted Pod Security profile, the client pod starts with a restricted securityContext and keeps running. The session is opened with kubectl exec. This is the form the Helm NOTES show:
kubectl run <RELEASE_NAME>-client --restart='Never' --namespace <NAMESPACE> \
--image registry.tecnisys.com.br/community/images/bitnamilegacy/postgresql:17.5.0-debian-12-r20 \
--overrides='{"apiVersion":"v1","spec":{"securityContext":{"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}},"containers":[{"name":"<RELEASE_NAME>-client","image":"registry.tecnisys.com.br/community/images/bitnamilegacy/postgresql:17.5.0-debian-12-r20","command":["sleep"],"args":["infinity"],"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}}]}}'
kubectl exec --namespace <NAMESPACE> -it <RELEASE_NAME>-client -- \
env PGPASSWORD="$POSTGRES_PASSWORD" psql -h <POSTGRESQL_SERVICE> -p 5432 -U postgres -d postgres
When you finish, remove the client pod:
kubectl delete pod <RELEASE_NAME>-client -n <NAMESPACE>
It worked when
postgres=# prompt appears. \l lists the databases, including the ones created by the other components.If the connection is refused
Check the Service name (kubectl -n <NAMESPACE> get svc) and whether the pod <POSTGRESQL_SERVICE>-0 is Running. A password failure after reinstalling is in When something goes wrong.
Or connect from your machineOpcional
A temporary tunnel to the Service, for one-off administration or diagnostics.
kubectl port-forward --namespace <NAMESPACE> svc/<POSTGRESQL_SERVICE> 5432:5432 &
psql -h 127.0.0.1 -p 5432 -U postgres -d postgres
The tunnel lasts while port-forward is running. It is not a permanent form of access.
Raise the connection limit for Hive Metastore and adjust the PostgreSQL configuration.
You are going to install Hive Metastore pointing to this PostgreSQL, and other components, such as Superset, Airflow, and OpenMetadata, will share the same instance. The default PostgreSQL connection limit (max_connections) does not accommodate Hive Metastore: on its own it needs hundreds of connections, in addition to those of the other clients. Raise max_connections before installing these components.
The limit lives in postgresql.conf, the PostgreSQL server configuration file. There are two ways to change it: append lines to the default configuration, which is the path to change only the limit, or replace the entire configuration.
primary.configuration and primary.extendedConfiguration empty: the PostgreSQL default configuration applies, with max_connections at 100.
PostgreSQL installed (scenario 1) and your values file. The change recreates the PostgreSQL pod: make it before installing the components that will use it.
The ways to change postgresql.conf
How to change postgresql.conf
- Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
- Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. No overrides: the PostgreSQL default configuration applies, including the default connection limit. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
How to change postgresql.conf: Append (extendedConfiguration)
- Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
- Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. The extendedConfiguration lines are appended to the default configuration. It is the way to change only what you need, such as max_connections. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
How to change postgresql.conf: Replace (primary.configuration)
- Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
- Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. The content of primary.configuration replaces the entire default configuration. With it set, extendedConfiguration is ignored. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
Append, the recommended way for the connection limit. The lines of primary.extendedConfiguration are appended to the PostgreSQL default configuration. You write only what changes, and everything else keeps coming from the default. Append: Best suited when only a few parameters change, such as the connection limit.
1tdp-postgresql:2primary:3 extendedConfiguration: |-4 max_connections = 500
Everything that belongs to PostgreSQL goes under the subchart key. Without this prefix, Helm does not apply the block.
- Chart prefix (linha 1). Everything that belongs to PostgreSQL goes under the subchart key. Without this prefix, Helm does not apply the block.
- extendedConfiguration (linha 3). Appends to the default configuration. It is ignored when primary.configuration is set: in that case, use the other way, above.
- max_connections (linha 4). Hive Metastore alone needs at least 400 to 500 connections, plus the other clients of this instance.
Replace, for whoever needs a complete configuration. The content of primary.configuration replaces the entire default configuration. Replace: Best suited when you need to tune the server beyond the connection limit, as in the chart example, which also sets the WAL and the logs.
With it set, extendedConfiguration is ignored: max_connections goes inside this block. The chart example, commented line by line:
1tdp-postgresql:2primary:3 configuration: |-4 listen_addresses = '*'5 max_connections = 4006 superuser_reserved_connections = 107 wal_level = 'replica'8 fsync = 'on'9 max_wal_size = '400MB'10 max_wal_senders = '16'11 wal_keep_size = '128MB'12 hot_standby = 'on'13 log_connections = 'false'14 log_disconnections = 'false'15 log_hostname = 'false'16 client_min_messages = 'error'
Replaces the entire default configuration. To return to the default, leave it empty or omit the block.
- configuration (linha 3). Replaces the entire default configuration. To return to the default, leave it empty or omit the block.
- listen_addresses (linha 4). Addresses on which PostgreSQL accepts connections. '*' accepts on all the pod interfaces.
- max_connections (linha 5). The connection limit. For Hive Metastore, at least 400 to 500, plus the other clients of this instance.
- Superuser reserve (linha 6). Connections kept for the superuser, even when the limit is reached.
- WAL (linha 7). The WAL lines control the PostgreSQL write-ahead log: level, size, and retention.
- Logs (linha 13). The log lines control what PostgreSQL records about connections and the level of the messages sent to the client.
Apply to the release
The PostgreSQL pod is recreated with the new configuration.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql \
--version 3.0.3 \
-n <NAMESPACE> -f <VALUES_FILE>
Without --version, Helm installs the latest published version of the chart.
It worked when
kubectl -n <NAMESPACE> get pods
The pod <POSTGRESQL_SERVICE>-0 returns to Running.
Check the limit
PostgreSQL answers with the new max_connections.
With the password read as in scenario 2:
kubectl -n <NAMESPACE> exec <POSTGRESQL_SERVICE>-0 -- \
env PGPASSWORD="$POSTGRES_PASSWORD" psql -U postgres -c "SHOW max_connections;"
It worked when
If the value did not change
With primary.configuration set, extendedConfiguration is ignored: put max_connections inside primary.configuration and apply again.
What Hive Metastore configures on its side, after this adjustment, is in Integrations - Hive Metastore.
Choose the size of the data volume and the pod resources.
The chart brings up a single primary instance. Sizing PostgreSQL means deciding the size of its data volume and how much CPU and memory the pod receives.
Before installing, you want to give PostgreSQL the disk and memory that your environment calls for: it will store the metadata of several components.
The chart already decides the defaults. Persistence comes on, and the StatefulSet creates the data volume on the first installation, with the size from primary.persistence.size. The pod CPU and memory come from primary.resources. These values are fixed and do not follow usage: when your environment calls for another size or more memory, you are the one who adjusts them. Only what departs from the default goes in the values file.
Persistence on (primary.persistence.enabled), with the size from primary.persistence.size. CPU and memory requests and limits in primary.resources (values in All parameters).
A StorageClass available for persistent volumes.
The PostgreSQL disk and memory
- Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
- Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. No overrides: the PostgreSQL default configuration applies, including the default connection limit. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
The values file
The block with the chart defaults, commented line by line. Replace the values with those of your environment.
1tdp-postgresql:2primary:3 persistence:4 enabled: true5 size: 1Gi6 resources:7 requests:8 memory: "1Gi"9 cpu: "500m"10 limits:11 memory: "2Gi"12 cpu: "1000m"
Everything that belongs to PostgreSQL goes under the subchart key.
- Chart prefix (linha 1). Everything that belongs to PostgreSQL goes under the subchart key.
- Persistence (linha 4). With persistence, the data lives in a PVC that survives the pod recreation and helm uninstall.
- Volume size (linha 5). The size of the PVC data-<POSTGRESQL_SERVICE>-0, created on the first installation.
- requests (linha 7). What Kubernetes reserves for the PostgreSQL pod.
- limits (linha 10). The memory and CPU ceiling of the pod.
Install with the values file
The volume and the pod come up with your values.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-postgresql \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace -f <VALUES_FILE>
Without --version, Helm installs the latest published version of the chart.
It worked when
kubectl -n <NAMESPACE> get pvc
kubectl -n <NAMESPACE> get pod <POSTGRESQL_SERVICE>-0 -o jsonpath='{.spec.containers[0].resources}'
The PVC data-<POSTGRESQL_SERVICE>-0 is Bound with the requested capacity, and the pod shows the requests and limits from the values file.
What the other charts receive from this PostgreSQL: address and administration password.
You want other TDP components to store their own metadata databases in this PostgreSQL: Hive Metastore, Airflow, Ranger, Superset, JupyterHub, OpenMetadata, or CloudBeaver. Nothing changes in this chart except the connection limit. Each component receives, in its own values file, the Service address and the name of the Secret with the administration password. A Job of the component chart creates its database and user.
The address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port, and the Secret tdp-postgresql-auth, postgres-password key.
The connection limit adjusted for all the clients of the instance (scenario 3).
The components that use this PostgreSQL
- Components that use this PostgreSQL. Each component receives the Service address in its own values file. A Job of the component chart creates its database and user with the administration password from the adjacent Secret.
- Service <POSTGRESQL_SERVICE>. The internal PostgreSQL address. The name derives from the release: <RELEASE_NAME>-tdp-postgresql, or just <RELEASE_NAME> when the release name already contains tdp-postgresql. The Helm NOTES, at the end of the installation, show the exact name. Chart default:
ClusterIP, on the service.port port. (tdp-postgresql.service.type · tdp-postgresql.service.port) - PostgreSQL. A single primary instance, in a StatefulSet. The superuser is postgres. CPU and memory requests and limits in primary.resources. Chart default:
one instance, with the requests and limits from primary.resources. (tdp-postgresql.primary.resources) - PostgreSQL configuration. The extendedConfiguration lines are appended to the default configuration. It is the way to change only what you need, such as max_connections. Chart default:
primary.configuration and primary.extendedConfiguration empty. (tdp-postgresql.primary.configuration · tdp-postgresql.primary.extendedConfiguration) - Data volume. Created by the StatefulSet in the cluster default StorageClass, with the size of primary.persistence.size. It stays after helm uninstall: a new installation in the same namespace finds the data again. Chart default:
on, with the size from primary.persistence.size. (tdp-postgresql.primary.persistence) - Administration password. The password of the postgres user, in the postgres-password key. The database Jobs of the other components read the same password. It stays after helm uninstall. Chart default:
tdp-postgresql-auth, postgres-password key. (tdp-postgresql.auth.existingSecret)
Check the address and the Secret
The two values you will carry to the component's values file.
kubectl -n <NAMESPACE> get svc
kubectl -n <NAMESPACE> get secret tdp-postgresql-auth
It worked when
<POSTGRESQL_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 that runs in the cluster reaches the database through the same address.
The side of each component, with the values file keys and each one's page, is in Integrations - PostgreSQL: Hive Metastore in scenario 2, Airflow, Ranger, Superset, JupyterHub, OpenMetadata, CloudBeaver, and Trino in scenario 3, and the component in a namespace different from PostgreSQL, with the Secret copy, in scenario 4.
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.
- license check failed. Cause: The TDP license is missing or invalid in the cluster. What to do: Install or renew the TDP license and check with kubectl get platformlicenses -A.
- Pods in ImagePullBackOff. Cause: The tdp-registry pull Secret does not exist in the release namespace. What to do: Create the tdp-registry Secret with your registry credentials (scenario 1).
- Pod or PVC stuck in Pending. Cause: The data volume was not created: there is no StorageClass available for persistent volumes. What to do: Make a StorageClass available in the cluster and check the data-<POSTGRESQL_SERVICE>-0 PVC.
- Permission error when writing to the volume. Cause: On standard Kubernetes, writing to the volume depends on the permissions that the StorageClass and the PersistentVolume give to the pod. What to do: Adjust the permissions in the StorageClass. The chart also has an init container that fixes the volume owner, turned off by default: tdp-postgresql.volumePermissions.enabled.
- max_connections did not change. Cause: primary.configuration is set: in that case, extendedConfiguration is ignored. What to do: Put max_connections inside primary.configuration (scenario 3).
- The old password or data came back after reinstalling. Cause: helm uninstall keeps the data PVC and the password Secret, and the new installation in the same namespace reuses both. What to do: To start from scratch, delete the PVC and the Secret after the uninstall (see What stays after uninstalling).
- Another problem. Cause: Start with the pods, the Service, the PVC, and the namespace events. What to do: The events in time order show what keeps the pod from starting.
What stays after uninstalling
helm uninstall <RELEASE_NAME> -n <NAMESPACE>
helm uninstall keeps two objects: the data PVC data-<POSTGRESQL_SERVICE>-0, created by the StatefulSet, and the Secret tdp-postgresql-auth. A new installation in the same namespace reuses both: the old data and password come back.
To start from scratch, delete both after the uninstall. This deletes all the databases stored in this PostgreSQL, including those of the other components.
kubectl delete pvc data-<POSTGRESQL_SERVICE>-0 -n <NAMESPACE>
kubectl delete secret tdp-postgresql-auth -n <NAMESPACE>
The removal order for all the components and the platform is in Uninstallation.
All parameters
Filter by name or by group. The chart prefix is already filled in.
17 of 17 parameters
| Parameter | Description | Chart default |
|---|---|---|
tdp-postgresql.postgresql.enabledGeneral | Enables the PostgreSQL subchart | true |
tdp-postgresql.service.typeGeneral | Service type | ClusterIP |
tdp-postgresql.service.portGeneral | Service port | 5432 |
tdp-postgresql.startupProbe.enabledGeneral | PostgreSQL startup probe | true |
tdp-postgresql.metrics.enabledGeneral | Metrics exporter in Prometheus format | false |
tdp-postgresql.auth.existingSecretCredentials | Secret with the password of the postgres superuser, created by the chart Job on the first installation if it does not exist | tdp-postgresql-auth |
tdp-postgresql.auth.secretKeys.adminPasswordKeyCredentials | Password key in the Secret | postgres-password |
tdp-postgresql.primary.persistence.enabledDisk and memory | Enables persistence | true |
tdp-postgresql.primary.persistence.sizeDisk and memory | Size of the data PVC | 1Gi |
tdp-postgresql.primary.resources.requests.cpuDisk and memory | Requested CPU | 500m |
tdp-postgresql.primary.resources.requests.memoryDisk and memory | Requested memory | 1Gi |
tdp-postgresql.primary.resources.limits.cpuDisk and memory | CPU limit | 1000m |
tdp-postgresql.primary.resources.limits.memoryDisk and memory | Memory limit | 2Gi |
tdp-postgresql.primary.configurationpostgresql.conf | Replaces the default postgresql.conf configuration | "" |
tdp-postgresql.primary.extendedConfigurationpostgresql.conf | Lines appended to the default configuration. Ignored when primary.configuration is set. For Hive Metastore, max_connections of at least 400 to 500, plus the other clients | "" |
tdp-postgresql.global.compatibility.openshift.adaptSecurityContextPlatform | OpenShift SCC compatibility mode | auto |
tdp-postgresql.volumePermissions.enabledPlatform | Init container that fixes the owner of the data volume | false |
For the complete list of parameters, see the chart values.yaml or run helm show values for the installed version.
Next steps
Hive Metastore
Integrations - Hive Metastore
The Hive catalog in this PostgreSQL, with the database hooks.