postgresql

by Diabolocom

Helm chartv12.1.2App 15.1.0

PostgreSQL (Postgres) is an open source object-relational database known for reliability and data integrity. ACID-compliant, it supports foreign keys, joins, views, triggers and stored procedures.

About this chart

PostgreSQL packaged by Bitnami

PostgreSQL (Postgres) is an open source object-relational database known for reliability and data integrity. ACID-compliant, it supports foreign keys, joins, views, triggers and stored procedures.

Overview of PostgreSQL

Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

helm repo add my-repo https://charts.bitnami.com/bitnami
helm install my-release my-repo/postgresql

Introduction

This chart bootstraps a PostgreSQL deployment on a Kubernetes cluster using the Helm package manager.

For HA, please see this repo

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.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 my-repo/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

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.storageClassGlobal StorageClass for Persistent Volume(s)""
global.postgresql.auth.postgresPasswordPassword for the "postgres" admin user (overrides auth.postgresPassword)""
global.postgresql.auth.usernameName for a custom user to create (overrides auth.username)""
global.postgresql.auth.passwordPassword for the custom user to create (overrides auth.password)""
global.postgresql.auth.databaseName for a custom database to create (overrides auth.database)""
global.postgresql.auth.existingSecretName of existing secret to use for PostgreSQL credentials (overrides auth.existingSecret).""
global.postgresql.auth.secretKeys.adminPasswordKeyName of key in existing secret to use for PostgreSQL credentials (overrides auth.secretKeys.adminPasswordKey). Only used when global.postgresql.auth.existingSecret is set.""
global.postgresql.auth.secretKeys.userPasswordKeyName of key in existing secret to use for PostgreSQL credentials (overrides auth.secretKeys.userPasswordKey). Only used when global.postgresql.auth.existingSecret is set.""
global.postgresql.auth.secretKeys.replicationPasswordKeyName of key in existing secret to use for PostgreSQL credentials (overrides auth.secretKeys.replicationPasswordKey). Only used when global.postgresql.auth.existingSecret is set.""
global.postgresql.service.ports.postgresqlPostgreSQL service port (overrides service.ports.postgresql)""

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
fullnameOverrideString to fully override common.names.fullname template""
clusterDomainKubernetes Cluster Domaincluster.local
extraDeployArray of extra objects to deploy with the release (evaluated as a template)[]
commonLabelsAdd labels to all the deployed resources{}
commonAnnotationsAdd annotations to all the deployed resources{}
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the statefulset["sleep"]
diagnosticMode.argsArgs to override all containers in the statefulset["infinity"]

PostgreSQL common parameters

NameDescriptionValue
image.registryPostgreSQL image registrydocker.io
image.repositoryPostgreSQL image repositorybitnami/postgresql
image.tagPostgreSQL image tag (immutable tags are recommended)15.1.0-debian-11-r0
image.digestPostgreSQL image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
image.pullPolicyPostgreSQL image pull policyIfNotPresent
image.pullSecretsSpecify image pull secrets[]
image.debugSpecify if debug values should be setfalse
auth.enablePostgresUserAssign a password to the "postgres" admin user. Otherwise, remote access will be blocked for this usertrue
auth.postgresPasswordPassword for the "postgres" admin user. Ignored if auth.existingSecret with key postgres-password is provided""
auth.usernameName for a custom user to create""
auth.passwordPassword for the custom user to create. Ignored if auth.existingSecret with key password is provided""
auth.databaseName for a custom database to create""
auth.replicationUsernameName of the replication userrepl_user
auth.replicationPasswordPassword for the replication user. Ignored if auth.existingSecret with key replication-password is provided""
`

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 v12.1.2 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