Skip to main content
Version 3.0

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.

ChartVersion3.0.3TypeapplicationAppVersion17.5.0
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+

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​

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.

Topology

A single primary PostgreSQL instance in a StatefulSet, with no read replicas.

Password

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.

Disk and memory

Persistent volume with the size from primary.persistence.size, in the cluster default StorageClass. Requests and limits in primary.resources (values in All parameters).

Access

Internal Service (ClusterIP) on the service.port port, for whoever runs inside the cluster.

Platform

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

namespace <NAMESPACE>Clients in the clustercomponents and psqlPassword Jobpre-install, pre-upgradeServiceClusterIP · service.portPostgreSQL<POSTGRESQL_SERVICE>-0 · primarypostgresql.confsubchart defaultData PVCdata-<POSTGRESQL_SERVICE>-0Secrettdp-postgresql-auth
  1. Who connects. Components and clients that run inside the cluster, through the address <POSTGRESQL_SERVICE>.<NAMESPACE>.svc.cluster.local, on the service.port port.
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
What comes up in the namespace with the chart defaults. Click an element to see what it is and the corresponding default.

Check the TDP license

The chart requires a valid TDP license installed in the cluster.

Terminal input
kubectl get platformlicenses -A

It worked when

The license appears in the list. If it does not, install the 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.

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

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

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

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

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

Terminal input
kubectl -n <NAMESPACE> get svc
kubectl -n <NAMESPACE> get pvc
kubectl -n <NAMESPACE> get secret tdp-postgresql-auth

It worked when

The Service <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.

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. 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.
  2. 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).
  3. 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.
  4. 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.
  5. 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).
  6. 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).
  7. 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​

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

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

ParameterDescriptionChart default
tdp-postgresql.postgresql.enabledGeneralEnables the PostgreSQL subcharttrue
tdp-postgresql.service.typeGeneralService typeClusterIP
tdp-postgresql.service.portGeneralService port5432
tdp-postgresql.startupProbe.enabledGeneralPostgreSQL startup probetrue
tdp-postgresql.metrics.enabledGeneralMetrics exporter in Prometheus formatfalse
tdp-postgresql.auth.existingSecretCredentialsSecret with the password of the postgres superuser, created by the chart Job on the first installation if it does not existtdp-postgresql-auth
tdp-postgresql.auth.secretKeys.adminPasswordKeyCredentialsPassword key in the Secretpostgres-password
tdp-postgresql.primary.persistence.enabledDisk and memoryEnables persistencetrue
tdp-postgresql.primary.persistence.sizeDisk and memorySize of the data PVC1Gi
tdp-postgresql.primary.resources.requests.cpuDisk and memoryRequested CPU500m
tdp-postgresql.primary.resources.requests.memoryDisk and memoryRequested memory1Gi
tdp-postgresql.primary.resources.limits.cpuDisk and memoryCPU limit1000m
tdp-postgresql.primary.resources.limits.memoryDisk and memoryMemory limit2Gi
tdp-postgresql.primary.configurationpostgresql.confReplaces the default postgresql.conf configuration""
tdp-postgresql.primary.extendedConfigurationpostgresql.confLines 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.adaptSecurityContextPlatformOpenShift SCC compatibility modeauto
tdp-postgresql.volumePermissions.enabledPlatformInit container that fixes the owner of the data volumefalse

For the complete list of parameters, see the chart values.yaml or run helm show values for the installed version.

Next steps​