For production deployments, use the CloudNativePG Operator instead of the Bitnami Helm chart. The operator provides:
-
Kubernetes-native PostgreSQL cluster management
-
Automated failover and high availability
-
Built-in backup and Point-in-Time Recovery (PITR)
-
Zero-downtime maintenance operations
-
Enhanced monitoring and observability
-
Production-grade security features
For development and demo environments, bitnami/postgresql chart can be used for quick setup.
Add bitnami repo to helm:
helm repo add bitnami <https://charts.bitnami.com/bitnami>Install PostgreSQL release for demo/development:
helm install postgresql bitnami/postgresql --version 16.0.1 -f postgresql-values.yamlNote:
-
The default configuration in
postgresql-values.yamlusesbitnamilegacyDocker images for compatibility -
This setup is not recommended for production use
NB: the values postgresql.enabled and postgresqlha.enabled must be false.
You can change default PostgreSQL config with the following variables in postgresql-values.yaml:
-
auth.database- name of a database.NB: must match
postgresql.databasevalue inwaldur/values.yaml -
auth.username- name of a database user.NB: must match
postgresql.usernamevalue inwaldur/values.yaml -
auth.password- password of a database user -
primary.persistence.size- size of a database -
image.tag- tag ofPostgreSQLimage.Possible tags for default image can be found here
-
image.registry- registry ofPostgreSQLimage.
More information related to possible values here.
Important:
-
The PostgreSQL configuration uses legacy Bitnami images (
bitnamilegacy/postgresqlandbitnamilegacy/postgres-exporter) for demo/development compatibility -
These images are configured in the
postgresql-values.yamlfile -
For production deployments, migrate to the CloudNativePG Operator
Waldur Helm chart supports PostgreSQL installation as a dependency.
For this, set postgresql.enabled to true and update related settings in postgresql section in waldur/values.yaml
NB: the value postgresqlha.enabled and externalDB.enabled must be false.
Prior Waldur installation, update chart dependencies:
helm dependency updateIn order to enable /api/query/ endpoint please make sure that read-only user is configured.
-- Create a read-only user
CREATE USER readonly WITH PASSWORD '{readonly_password}'
-- Grant read-only access to the database
GRANT CONNECT ON DATABASE '{database_name}' TO '{readonly_username}'
-- Grant read-only access to the schema
GRANT USAGE ON SCHEMA public TO '{readonly_username}'
-- Grant read-only access to existing tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO '{readonly_username}'
-- Grant read-only access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO '{readonly_username}'
-- Revoke access to authtoken_token table
REVOKE SELECT ON authtoken_token FROM '{readonly_username}'