postgresql
by kubelauncher
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
| Key | Type | Default | Description |
|---|---|---|---|
| architecture | string | "standalone" | |
| auth.database | string | "" | |
| auth.enablePostgresUser | bool | true | |
| auth.existingSecret | string | "" | |
| auth.password | string | "" | |
| auth.postgresPassword | string | "" | |
| auth.replicationPassword | string | "" | |
| auth.replicationUsername | string | "repl_user" | |
| auth.secretKeys.adminPasswordKey | string | "postgres-password" | |
| auth.secretKeys.replicationPasswordKey | string | "replication-password" | |
| auth.secretKeys.userPasswordKey | string | "password" | |
| auth.username | string | "" | |
| clusterDomain | string | "cluster.local" | |
| commonAnnotations | object | {} | |
| commonLabels | object | {} | |
| enableServiceLinks | bool | false | |
| extraDeploy | list | [] | |
| fullnameOverride | string | "" | |
| global.defaultStorageClass | string | "" | |
| global.imagePullSecrets | list | [] | |
| global.imageRegistry | string | "" | |
| global.postgresql.auth.database | string | "" | |
| global.postgresql.auth.existingSecret | string | "" | |
| global.postgresql.auth.password | string | "" | |
| global.postgresql.auth.postgresPassword | string | "" | |
| global.postgresql.auth.username | string | "" | |
| global.postgresql.service.ports.postgresql | string | "" | |
| global.storageClass | string | "" | |
| image.digest | string | "sha256:e1d24c7b2e8915040fad9d7ead89b78da9b3a9e8c7af61b79d2b517e750e7f11" | |
| image.pullPolicy | string | "Always" | |
| image.pullSecrets | list | [] | |
| image.registry | string | "ghcr.io" | |
| image.repository | string | "kubelauncher/postgresql" | |
| image.tag | string | "17.11" | |
| metrics.containerPorts.metrics | int | 9187 | |
| metrics.enabled | bool | false | |
| metrics.image.pullPolicy | string | "Always" | |
| metrics.image.registry | string | "ghcr.io" | |
| metrics.image.repository | string | "kubelauncher/postgres-exporter" | |
| metrics.image.tag | string | "0.19.0" | |
| metrics.serviceMonitor.enabled | bool | false | |
| metrics.serviceMonitor.interval | string | "" | |
| metrics.serviceMonitor.labels | object | {} | |
| metrics.serviceMonitor.scrapeTimeout | string | "" | |
| nameOverride | string | "" | |
| namespaceOverride | string | "" | |
| networkPolicy.additionalRules | list | [] | |
| networkPolicy.allowExternal | bool | true | |
| networkPolicy.enabled | bool | false | |
| primary.affinity | object | {} | |
| primary.configuration | string | "" | |
| primary.containerPorts.postgresql | int | 5432 | |
| primary.containerSecurityContext.allowPrivilegeEscalation | bool | false | |
| primary.containerSecurityContext.capabilities.drop[0] | string | "ALL" | |
| primary.containerSecurityContext.enabled | bool | true | |
| primary.containerSecurityContext.readOnlyRootFilesystem | bool | false | |
| primary.containerSecurityContext.runAsGroup | int | 1001 | |
| primary.containerSecurityContext.runAsNonRoot | bool | true | |
| primary.containerSecurityContext.runAsUser | int | 1001 | |
| primary.containerSecurityContext.seccompProfile.type | string | "RuntimeDefault" | |
| primary.extraEnvVars | list | [] | |
| primary.extraVolumeMounts | list | [] | |
| primary.extraVolumes | list | [] | |
| primary.initContainers | list | [] | |
| primary.initdb.args | string | "--auth-host=md5" | |
| primary.initdb.scripts | object | {} | |
| primary.initdb.scriptsConfigMap | string | "" | |
| primary.initdb.scriptsSecret | string | "" | |
| primary.livenessProbe.enabled | bool | true | |
| primary.livenessProbe.failureThreshold | int | 6 | |
| primary.livenessProbe.initialDelaySeconds | int | 30 | |
| primary.livenessProbe.periodSeconds | int | 10 | |
| primary.livenessProbe.successThreshold | int | 1 | |
| primary.livenessProbe.timeoutSeconds | int | 5 | |
| primary.name | string | "primary" | |
| primary.nodeSelector | object | {} | |
| primary.persistence.accessModes[0] | string | "ReadWriteOnce" | |
| primary.persistence.annotations | object | {} | |
| primary.persistence.enabled | bool | true | |
| primary.persistence.existingClaim | string | "" | |
| primary.persistence.labels | object | {} | |
| primary.persistence.mountPath | string | "/data/postgresql" | |
| primary.persistence.size | string | "8Gi" | |
| primary.persistence.storageClass | string | "" | |
| primary.pgHbaConfiguration | string | "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.podAnnotations | object | {} | |
| primary.podLabels | object | {} | |
| primary.podSecurityContext.enabled | bool | true | |
| primary.podSecurityContext.fsGroup | int | 1001 | |
| primary.readinessProbe.enabled | bool | true | |
| primary.readinessProbe.failureThreshold | int | 6 | |
| primary.readinessProbe.initialDelaySeconds | int | 5 | |
| primary.readinessProbe.periodSeconds | int | 10 | |
| primary.readinessProbe.successThreshold | int | 1 | |
| primary.readinessProbe.timeoutSeconds | int | 5 | |
| primary.replicaCount | int | 1 | |
| primary.resources | object | {} | |
| primary.resourcesPreset | string | "micro" | |
| primary.service.annotations | object | {} | |
| primary.service.clusterIP | string | "" | |
| primary.service.headless.annotations | object | {} | |
| primary.service.labels | object | {} | |
| primary.service.nodePorts.postgresql | string | "" | |
| primary.service.ports.postgresql | int | 5432 | |
| primary.service.type | string | "ClusterIP" | |
| primary.sidecars | list | [] | |
| primary.startupProbe.enabled | bool | true | |
| primary.startupProbe.failureThreshold | int | 30 | |
| primary.startupProbe.initialDelaySeconds | int | 10 | |
| primary.startupProbe.periodSeconds | int | 10 | |
| primary.startupProbe.successThreshold | int | 1 | |
| primary.startupProbe.timeoutSeconds | int | 5 | |
| primary.tolerations | list | [] | |
| readReplicas.affinity | object | {} | |
| readReplicas.containerPorts.postgresql | int | 5432 | |
| readReplicas.containerSecurityContext.allowPrivilegeEscalation | bool | false | |
| readReplicas.containerSecurityContext.capabilities.drop[0] | string | "ALL" | |
| readReplicas.containerSecurityContext.enabled | bool | true | |
| readReplicas.containerSecurityContext.readOnlyRootFilesystem | bool | false | |
| readReplicas.containerSecurityContext.runAsGroup | int | 1001 | |
| readReplicas.containerSecurityContext.runAsNonRoot | bool | true | |
| readReplicas.containerSecurityContext.runAsUser | int | 1001 | |
| readReplicas.containerSecurityContext.seccompProfile.type | string | "RuntimeDefault" | |
| readReplicas.extraEnvVars | list | [] | |
| readReplicas.extraVolumeMounts | list | [] | |
| readReplicas.extraVolumes | list | [] | |
| readReplicas.initContainers | list | [] | |
| readReplicas.name | string | "read" | |
| readReplicas.nodeSelector | object | {} | |
| readReplicas.persistence.accessModes[0] | string | "ReadWriteOnce" | |
| readReplicas.persistence.annotations | object | {} | |
| readReplicas.persistence.enabled | bool | true | |
| readReplicas.persistence.existingClaim | string | "" | |
| readReplicas.persistence.labels | object | {} | |
| readReplicas.persistence.mountPath | string | "/data/postgresql" | |
| readReplicas.persistence.size | string | "8Gi" | |
| readReplicas.persistence.storageClass | string | "" | |
| readReplicas.podAnnotations | object | {} | |
| readReplicas.podLabels | object | {} | |
| readReplicas.podSecurityContext.enabled | bool | true | |
| readReplicas.podSecurityContext.fsGroup | int | 1001 | |
| readReplicas.replicaCount | int | 1 | |
| readReplicas.resources | object | {} | |
| readReplicas.resourcesPreset | string | "micro" | |
| readReplicas.service.annotations | object | {} | |
| readReplicas.service.clusterIP | string | "" | |
| readReplicas.service.headless.annotations | object | {} | |
| readReplicas.service.labels | object | {} | |
| readReplicas.service.nodePorts.postgresql | string | "" | |
| readReplicas.service.ports.postgresql | int | 5432 | |
| readReplicas.service.type | string | "ClusterIP" | |
| readReplicas.sidecars | list | [] | |
| readReplicas.tolerations | list | [] | |
| serviceAccount.annotations | object | {} | |
| serviceAccount.automountServiceAccountToken | bool | false | |
| serviceAccount.create | bool | true | |
| serviceAccount.name | string | "" |
Maintainers
| Name | Url | |
|---|---|---|
| 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpostgresql is pinned at v0.5.2 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