postgresql
by [riftbit]
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 3.1.0
- 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
Global parameters
| Name | Description | Value |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.storageClass | Global StorageClass for Persistent Volume(s) | "" |
global.postgresql.postgresqlDatabase | PostgreSQL database (overrides postgresqlDatabase) | "" |
global.postgresql.postgresqlUsername | PostgreSQL username (overrides postgresqlUsername) | "" |
global.postgresql.existingSecret | Name of existing secret to use for PostgreSQL passwords (overrides existingSecret) | "" |
global.postgresql.postgresqlPassword | PostgreSQL admin password (overrides postgresqlPassword) | "" |
global.postgresql.servicePort | PostgreSQL port (overrides service.port | "" |
global.postgresql.replicationPassword | Replication user password (overrides replication.password) | "" |
Common parameters
| Name | Description | Value |
|---|---|---|
nameOverride | String to partially override common.names.fullname template (will maintain the release name) | "" |
fullnameOverride | String to fully override common.names.fullname template | "" |
extraDeploy | Array of extra objects to deploy with the release (evaluated as a template) | [] |
commonAnnotations | Add annotations to all the deployed resources | {} |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | ["sleep"] |
diagnosticMode.args | Args to override all containers in the deployment | ["infinity"] |
PostgreSQL parameters
| Name | Description | Value |
|---|---|---|
image.registry | PostgreSQL image registry | docker.io |
image.repository | PostgreSQL image repository | bitnami/postgresql |
image.tag | PostgreSQL image tag (immutable tags are recommended) | 11.13.0-debian-10-r40 |
image.pullPolicy | PostgreSQL image pull policy | IfNotPresent |
image.pullSecrets | Specify image pull secrets | [] |
image.debug | Specify if debug values should be set | false |
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 repository | bitnami/bitnami-shell |
volumePermissions.image.tag | Init container volume-permissions image tag (immutable tags are recommended) | 10-debian-10-r200 |
volumePermissions.image.pullPolicy | Init container volume-permissions image pull policy | Always |
volumePermissions.image.pullSecrets | Init container volume-permissions image pull secrets | [] |
volumePermissions.securityContext.runAsUser | User ID for the init container | 0 |
schedulerName | Use an alternate scheduler, e.g. "stork". | "" |
lifecycleHooks | for the PostgreSQL container to automate configuration before or after startup | {} |
securityContext.enabled | Enable security context | true |
securityContext.fsGroup | Group ID for the pod | 1001 |
containerSecurityContext.enabled | Enable container security context | true |
containerSecurityContext.runAsUser | User ID for the container | 1001 |
serviceAccount.enabled | Enable service account (Note: Service Account will only be automatically created if serviceAccount.name is not set) | false |
serviceAccount.name | Name of an already existing service account. Setting this value disables the automatic service account creation | "" |
serviceAccount.autoMount | Auto-mount the service account token in the pod | false |
psp.create | Create Pod Security Policy | false |
rbac.create | Create Role and RoleBinding (required for PSP to work) | false |
replication.enabled | Enable replication | false |
replication.user | Replication user | repl_user |
replication.password | Replication user password | repl_password |
replication.readReplicas | Number of read replicas 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.readReplicas. | 0 |
replication.applicationName | Cluster application name. Useful for advanced replication settings | my_application |
replication.singleService | Create one service connecting to all read-replicas | true |
replication.uniqueServices | Create a unique service for each independent read-replica | false |
postgresqlPostgresPassword | PostgreSQL admin password (used when postgresqlUsername is not postgres, in which casepostgres is the admin username) | "" |
postgresqlUsername | PostgreSQL user (has superuser privileges if username is postgres) | postgres |
postgresqlPassword | PostgreSQL user password | "" |
existingSecret | Name of existing secret to use for PostgreSQL passwords | "" |
usePasswordFile | Mount PostgreSQL secret as a |
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 v10.11.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