postgresql

by duyet

Helm chartv9.3.3App 11.9.0

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.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker Image registrynil
global.postgresql.postgresqlDatabasePostgreSQL database (overrides postgresqlDatabase)nil
global.postgresql.postgresqlUsernamePostgreSQL username (overrides postgresqlUsername)nil
global.postgresql.existingSecretName of existing secret to use for PostgreSQL passwords (overrides existingSecret)nil
global.postgresql.postgresqlPasswordPostgreSQL admin password (overrides postgresqlPassword)nil
global.postgresql.servicePortPostgreSQL port (overrides service.port)nil
global.postgresql.replicationPasswordReplication user password (overrides replication.password)nil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
global.storageClassGlobal storage class for dynamic provisioningnil
image.registryPostgreSQL Image registrydocker.io
image.repositoryPostgreSQL Image namebitnami/postgresql
image.tagPostgreSQL Image tag{TAG_NAME}
image.pullPolicyPostgreSQL Image pull policyIfNotPresent
image.pullSecretsSpecify Image pull secretsnil (does not add image pull secrets to deployed pods)
image.debugSpecify if debug values should be setfalse
nameOverrideString to partially override postgresql.fullname template with a string (will prepend the release name)nil
fullnameOverrideString to fully override postgresql.fullname template with a stringnil
volumePermissions.enabledEnable 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.registryInit container volume-permissions image registrydocker.io
volumePermissions.image.repositoryInit container volume-permissions image namebitnami/minideb
volumePermissions.image.tagInit container volume-permissions image tagbuster
volumePermissions.image.pullPolicyInit container volume-permissions image pull policyAlways
volumePermissions.securityContext.runAsUserUser ID for the init container (when facing issues in OpenShift or uid unknown, try value "auto")0
usePasswordFileHave the secrets mounted as a file instead of env varsfalse
ldap.enabledEnable LDAP supportfalse
ldap.existingSecretName of existing secret to use for LDAP passwordsnil
ldap.urlLDAP URL beginning in the form ldap[s]://host[:port]/basedn[?[attribute][?[scope][?[filter]]]]nil
ldap.serverIP address or name of the LDAP server.nil
ldap.portPort number on the LDAP server to connect tonil
ldap.schemeSet to ldaps to use LDAPS.nil
ldap.tlsSet to 1 to use TLS encryptionnil
ldap.prefixString to prepend to the user name when forming the DN to bindnil
ldap.suffixString to append to the user name when forming the DN to bindnil
ldap.search_attrAttribute to match agains the user name in the searchnil
ldap.search_filterThe search filter to use when doing search+bind authenticationnil
ldap.baseDNRoot DN to begin the search for the user innil
ldap.bindDNDN of user to bind to LDAPnil
ldap.bind_passwordPassword for the user to bind to LDAPnil
replication.enabledEnable replicationfalse
replication.userReplication userrepl_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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpostgresql is pinned at v9.3.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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