postgresql
by duyet
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.
For HA, please see this repo
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/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.12+
- Helm 2.12+ or Helm 3.0-beta3+
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm install my-release bitnami/postgresql
The command deploys PostgreSQL on the Kubernetes cluster in the default configuration. The Parameters 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 but PVC's associated with the chart and deletes the release.
To delete the PVC's associated with my-release:
$ kubectl delete pvc -l release=my-release
Note: Deleting the PVC's will delete postgresql data as well. Please be cautious before doing it.
Parameters
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 | PostgreSQL admin password (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) |
global.storageClass | Global storage class for dynamic provisioning | nil |
image.registry | PostgreSQL Image registry | docker.io |
image.repository | PostgreSQL Image name | bitnami/postgresql |
image.tag | PostgreSQL Image tag | {TAG_NAME} |
image.pullPolicy | PostgreSQL Image pull policy | IfNotPresent |
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 |
nameOverride | String to partially override postgresql.fullname template with a string (will prepend the release name) | nil |
fullnameOverride | String to fully override postgresql.fullname template with a string | nil |
volumePermissions.enabled | Enable init container that changes volume permissions in the data directory (for cases where the default k8s runAsUser and fsUser values do not work) | 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 | buster |
volumePermissions.image.pullPolicy | Init container volume-permissions image pull policy | Always |
volumePermissions.securityContext.runAsUser | User ID for the init container (when facing issues in OpenShift or uid unknown, try value "auto") | 0 |
usePasswordFile | Have the secrets mounted as a file instead of env vars | false |
ldap.enabled | Enable LDAP support | false |
ldap.existingSecret | Name of existing secret to use for LDAP passwords | nil |
ldap.url | LDAP URL beginning in the form ldap[s]://host[:port]/basedn[?[attribute][?[scope][?[filter]]]] | nil |
ldap.server | IP address or name of the LDAP server. | nil |
ldap.port | Port number on the LDAP server to connect to | nil |
ldap.scheme | Set to ldaps to use LDAPS. | nil |
ldap.tls | Set to 1 to use TLS encryption | nil |
ldap.prefix | String to prepend to the user name when forming the DN to bind | nil |
ldap.suffix | String to append to the user name when forming the DN to bind | nil |
ldap.search_attr | Attribute to match agains the user name in the search | nil |
ldap.search_filter | The search filter to use when doing search+bind authentication | nil |
ldap.baseDN | Root DN to begin the search for the user in | nil |
ldap.bindDN | DN of user to bind to LDAP | nil |
ldap.bind_password | Password for the user to bind to LDAP | nil |
replication.enabled | Enable replication | false |
replication.user | Replication user | repl_user |
| `replication.passwo |
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 v9.3.3 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