postgresql
Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
About this chart
PostgreSQL
PostgreSQL is an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
TL;DR;
$ helm install <helm-repo>/postgresql
$ helm install stable/postgresql
Introduction
This chart bootstraps a PostgreSQL deployment on a Kubernetes cluster using the Helm package manager.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the BKPR.
Prerequisites
- Kubernetes 1.10+
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm install --name my-release <helm-repo>/postgresql
$ helm install --name my-release stable/postgresql The command deploys PostgreSQL on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Configuration
The following tables lists the configurable parameters of the PostgreSQL chart and their default values.
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker Image registry | nil |
global.postgresql.postgresqlDatabase | PostgreSQL database (overrides postgresqlDatabase) | nil |
global.postgresql.postgresqlUsername | PostgreSQL username (overrides postgresqlUsername) | nil |
global.postgresql.existingSecret | Name of existing secret to use for PostgreSQL passwords (overrides existingSecret) | nil |
global.postgresql.postgresqlPassword | Name of existing secret to use for PostgreSQL passwords (overrides postgresqlPassword) | nil |
global.postgresql.servicePort | PostgreSQL port (overrides service.port) | nil |
global.postgresql.replicationPassword | Replication user password (overrides replication.password) | nil |
global.imagePullSecrets | Global Docker registry secret names as an array | [] (does not add image pull secrets to deployed pods) |
image.registry | PostgreSQL Image registry | docker.io |
image.repository | PostgreSQL Image name | bitnami/postgresql |
image.tag | PostgreSQL Image tag | {VERSION} |
image.pullPolicy | PostgreSQL Image pull policy | Always |
image.pullSecrets | Specify Image pull secrets | nil (does not add image pull secrets to deployed pods) |
image.debug | Specify if debug values should be set | false |
volumePermissions.image.registry | Init container volume-permissions image registry | docker.io |
volumePermissions.image.repository | Init container volume-permissions image name | bitnami/minideb |
volumePermissions.image.tag | Init container volume-permissions image tag | latest |
volumePermissions.image.pullPolicy | Init container volume-permissions image pull policy | Always |
volumePermissions.securityContext.runAsUser | User ID for the init container | 0 |
usePasswordFile | Have the secrets mounted as a file instead of env vars | false |
replication.enabled | Would you like to enable replication | false |
replication.user | Replication user | repl_user |
replication.password | Replication user password | repl_password |
replication.slaveReplicas | Number of slaves replicas | 1 |
replication.synchronousCommit | Set synchronous commit mode. Allowed values: on, remote_apply, remote_write, local and off | off |
replication.numSynchronousReplicas | Number of replicas that will have synchronous replication. Note: Cannot be greater than replication.slaveReplicas. | 0 |
replication.applicationName | Cluster application name. Useful for advanced replication settings | my_application |
existingSecret | Name of existing secret to use for PostgreSQL passwords | nil |
postgresqlUsername | PostgreSQL admin user | postgres |
postgresqlPassword | PostgreSQL admin password | random 10 character alphanumeric string |
postgresqlDatabase | PostgreSQL database | nil |
postgresqlDataDir | PostgreSQL data dir folder | /bitnami/postgresql (same value as persistence.mountPath) |
postgresqlInitdbArgs | PostgreSQL initdb extra arguments | nil |
postgresqlInitdbWalDir | PostgreSQL location for transaction log | nil |
postgresqlConfiguration | Runtime Config Parameters | nil |
postgresqlExtendedConf | Extended Runtime Config Parameters (appended to main or default configuration) | nil |
pgHbaConfiguration | Content of pg_hba.conf | nil (do not create pg_hba.conf) |
configurationConfigMap | ConfigMap with the PostgreSQL configuration files (Note: Overrides postgresqlConfiguration and pgHbaConfiguration). The value is evaluated as a template. | nil |
extendedConfConfigMap | ConfigMap with the extended PostgreSQL configuration files. The value is evaluated as a template. | nil |
initdbScripts | Dictionary of initdb scripts | nil |
initdbScriptsConfigMap | ConfigMap with the initdb scripts (Note: Overrides initdbScripts). The value is evaluated as a template. | nil |
initdbScriptsSecret | Secret with initdb scripts that contain sensitive information (Note: can be used with initdbScriptsConfigMap or initdbScripts). The value is evaluated as a template. | nil |
service.type | Kubernetes Service type | ClusterIP |
service.port | PostgreSQL port | 5432 |
service.nodePort | Kubernetes Service nodePort | nil |
service.annotations | Annotations for PostgreSQL service | {} |
service.loadBalancerIP | loadBalancerIP if service type is LoadBalancer | nil |
service.loadBalancerSourceRanges | Address that are allowed when svc is LoadBalancer | [] |
persistence.enabled | Enable persistence using PVC | true |
persistence.existingClaim | Provide an existing PersistentVolumeClaim, the value is evaluated as a template. | nil |
persistence.mountPath | Path to mount the volume at |
Deploy postgresql with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has postgresql on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpostgresql is pinned at v5.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply