postgresql

by kubelauncher

Helm chartv0.5.2App 17.11Apache-2.0Verified publisher

PostgreSQL relational database

About this chart

postgresql

PostgreSQL relational database

TL;DR

helm repo add kubelauncher https://kubelauncher.github.io/charts
helm install my-pg kubelauncher/postgresql \
  --set auth.postgresPassword=secret

Or via OCI:

helm install my-pg oci://ghcr.io/kubelauncher/charts/postgresql \
  --set auth.postgresPassword=secret

Introduction

This chart deploys PostgreSQL on Kubernetes using the kubelauncher/postgresql Docker image. It supports standalone and replication architectures with init script support.

The values structure follows the same conventions as popular community charts, allowing easy migration.

Architecture

Standalone (default)

A single PostgreSQL instance. Suitable for development and small production workloads.

helm install my-pg kubelauncher/postgresql \
  --set auth.postgresPassword=admin \
  --set auth.username=myuser \
  --set auth.password=mypass \
  --set auth.database=mydb

Replication

One primary with streaming read replicas. Read replicas handle read-only queries and provide data redundancy.

helm install my-pg kubelauncher/postgresql \
  --set architecture=replication \
  --set auth.postgresPassword=admin \
  --set auth.replicationUsername=repl_user \
  --set auth.replicationPassword=replsecret \
  --set readReplicas.replicaCount=2

Read replicas connect to the primary via PostgreSQL streaming replication. Each replica has its own PVC for data persistence.

Installing the Chart

helm repo add kubelauncher https://kubelauncher.github.io/charts
helm install my-pg kubelauncher/postgresql \
  --set auth.postgresPassword=admin \
  --set auth.username=myuser \
  --set auth.password=mypass \
  --set auth.database=mydb

Or via OCI:

helm install my-pg oci://ghcr.io/kubelauncher/charts/postgresql \
  --set auth.postgresPassword=admin \
  --set auth.username=myuser \
  --set auth.password=mypass \
  --set auth.database=mydb

Uninstalling the Chart

helm uninstall my-pg

Values

KeyTypeDefaultDescription
architecturestring"standalone"
auth.databasestring""
auth.enablePostgresUserbooltrue
auth.existingSecretstring""
auth.passwordstring""
auth.postgresPasswordstring""
auth.replicationPasswordstring""
auth.replicationUsernamestring"repl_user"
auth.secretKeys.adminPasswordKeystring"postgres-password"
auth.secretKeys.replicationPasswordKeystring"replication-password"
auth.secretKeys.userPasswordKeystring"password"
auth.usernamestring""
clusterDomainstring"cluster.local"
commonAnnotationsobject{}
commonLabelsobject{}
enableServiceLinksboolfalse
extraDeploylist[]
fullnameOverridestring""
global.defaultStorageClassstring""
global.imagePullSecretslist[]
global.imageRegistrystring""
global.postgresql.auth.databasestring""
global.postgresql.auth.existingSecretstring""
global.postgresql.auth.passwordstring""
global.postgresql.auth.postgresPasswordstring""
global.postgresql.auth.usernamestring""
global.postgresql.service.ports.postgresqlstring""
global.storageClassstring""
image.digeststring"sha256:e1d24c7b2e8915040fad9d7ead89b78da9b3a9e8c7af61b79d2b517e750e7f11"
image.pullPolicystring"Always"
image.pullSecretslist[]
image.registrystring"ghcr.io"
image.repositorystring"kubelauncher/postgresql"
image.tagstring"17.11"
metrics.containerPorts.metricsint9187
metrics.enabledboolfalse
metrics.image.pullPolicystring"Always"
metrics.image.registrystring"ghcr.io"
metrics.image.repositorystring"kubelauncher/postgres-exporter"
metrics.image.tagstring"0.19.0"
metrics.serviceMonitor.enabledboolfalse
metrics.serviceMonitor.intervalstring""
metrics.serviceMonitor.labelsobject{}
metrics.serviceMonitor.scrapeTimeoutstring""
nameOverridestring""
namespaceOverridestring""
networkPolicy.additionalRuleslist[]
networkPolicy.allowExternalbooltrue
networkPolicy.enabledboolfalse
primary.affinityobject{}
primary.configurationstring""
primary.containerPorts.postgresqlint5432
primary.containerSecurityContext.allowPrivilegeEscalationboolfalse
primary.containerSecurityContext.capabilities.drop[0]string"ALL"
primary.containerSecurityContext.enabledbooltrue
primary.containerSecurityContext.readOnlyRootFilesystemboolfalse
primary.containerSecurityContext.runAsGroupint1001
primary.containerSecurityContext.runAsNonRootbooltrue
primary.containerSecurityContext.runAsUserint1001
primary.containerSecurityContext.seccompProfile.typestring"RuntimeDefault"
primary.extraEnvVarslist[]
primary.extraVolumeMountslist[]
primary.extraVolumeslist[]
primary.initContainerslist[]
primary.initdb.argsstring"--auth-host=md5"
primary.initdb.scriptsobject{}
primary.initdb.scriptsConfigMapstring""
primary.initdb.scriptsSecretstring""
primary.livenessProbe.enabledbooltrue
primary.livenessProbe.failureThresholdint6
primary.livenessProbe.initialDelaySecondsint30
primary.livenessProbe.periodSecondsint10
primary.livenessProbe.successThresholdint1
primary.livenessProbe.timeoutSecondsint5
primary.namestring"primary"
primary.nodeSelectorobject{}
primary.persistence.accessModes[0]string"ReadWriteOnce"
primary.persistence.annotationsobject{}
primary.persistence.enabledbooltrue
primary.persistence.existingClaimstring""
primary.persistence.labelsobject{}
primary.persistence.mountPathstring"/data/postgresql"
primary.persistence.sizestring"8Gi"
primary.persistence.storageClassstring""
primary.pgHbaConfigurationstring"local all all trust\nhost all all 127.0.0.1/32 trust\nhost all all ::1/128 trust\nhost all all 0.0.0.0/0 md5\nhost all all ::/0 md5"
primary.podAnnotationsobject{}
primary.podLabelsobject{}
primary.podSecurityContext.enabledbooltrue
primary.podSecurityContext.fsGroupint1001
primary.readinessProbe.enabledbooltrue
primary.readinessProbe.failureThresholdint6
primary.readinessProbe.initialDelaySecondsint5
primary.readinessProbe.periodSecondsint10
primary.readinessProbe.successThresholdint1
primary.readinessProbe.timeoutSecondsint5
primary.replicaCountint1
primary.resourcesobject{}
primary.resourcesPresetstring"micro"
primary.service.annotationsobject{}
primary.service.clusterIPstring""
primary.service.headless.annotationsobject{}
primary.service.labelsobject{}
primary.service.nodePorts.postgresqlstring""
primary.service.ports.postgresqlint5432
primary.service.typestring"ClusterIP"
primary.sidecarslist[]
primary.startupProbe.enabledbooltrue
primary.startupProbe.failureThresholdint30
primary.startupProbe.initialDelaySecondsint10
primary.startupProbe.periodSecondsint10
primary.startupProbe.successThresholdint1
primary.startupProbe.timeoutSecondsint5
primary.tolerationslist[]
readReplicas.affinityobject{}
readReplicas.containerPorts.postgresqlint5432
readReplicas.containerSecurityContext.allowPrivilegeEscalationboolfalse
readReplicas.containerSecurityContext.capabilities.drop[0]string"ALL"
readReplicas.containerSecurityContext.enabledbooltrue
readReplicas.containerSecurityContext.readOnlyRootFilesystemboolfalse
readReplicas.containerSecurityContext.runAsGroupint1001
readReplicas.containerSecurityContext.runAsNonRootbooltrue
readReplicas.containerSecurityContext.runAsUserint1001
readReplicas.containerSecurityContext.seccompProfile.typestring"RuntimeDefault"
readReplicas.extraEnvVarslist[]
readReplicas.extraVolumeMountslist[]
readReplicas.extraVolumeslist[]
readReplicas.initContainerslist[]
readReplicas.namestring"read"
readReplicas.nodeSelectorobject{}
readReplicas.persistence.accessModes[0]string"ReadWriteOnce"
readReplicas.persistence.annotationsobject{}
readReplicas.persistence.enabledbooltrue
readReplicas.persistence.existingClaimstring""
readReplicas.persistence.labelsobject{}
readReplicas.persistence.mountPathstring"/data/postgresql"
readReplicas.persistence.sizestring"8Gi"
readReplicas.persistence.storageClassstring""
readReplicas.podAnnotationsobject{}
readReplicas.podLabelsobject{}
readReplicas.podSecurityContext.enabledbooltrue
readReplicas.podSecurityContext.fsGroupint1001
readReplicas.replicaCountint1
readReplicas.resourcesobject{}
readReplicas.resourcesPresetstring"micro"
readReplicas.service.annotationsobject{}
readReplicas.service.clusterIPstring""
readReplicas.service.headless.annotationsobject{}
readReplicas.service.labelsobject{}
readReplicas.service.nodePorts.postgresqlstring""
readReplicas.service.ports.postgresqlint5432
readReplicas.service.typestring"ClusterIP"
readReplicas.sidecarslist[]
readReplicas.tolerationslist[]
serviceAccount.annotationsobject{}
serviceAccount.automountServiceAccountTokenboolfalse
serviceAccount.createbooltrue
serviceAccount.namestring""

Maintainers

NameEmailUrl
kubelauncher[email protected]https://www.kubelauncher.com

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 v0.5.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