A Helm chart for PostgreSQL using SamSoft hardened Docker image (runs as UID 1001)
About this chart
PostgreSQL Helm Chart
A Helm chart for deploying PostgreSQL using SamSoft hardened Docker images.
Overview
This chart deploys PostgreSQL, the world's most advanced open-source relational database, on Kubernetes. It uses SamSoft's hardened container images that run as non-root (UID 1001) with security best practices.
PostgreSQL main configuration to inject as ConfigMap
primary.pgHbaConfiguration
string
""
PostgreSQL client authentication configuration
primary.existingConfigmap
string
""
Existing ConfigMap with PostgreSQL configuration
primary.extendedConfiguration
string
""
Extended PostgreSQL configuration
primary.existingExtendedConfigmap
string
""
Existing ConfigMap with extended configuration
primary.initdb.args
string
""
PostgreSQL initdb extra arguments
primary.initdb.postgresqlWalDir
string
""
Custom location for transaction log
primary.initdb.scripts
object
{}
Dictionary of initdb scripts
primary.initdb.scriptsConfigMap
string
""
ConfigMap with initdb scripts
primary.initdb.scriptsSecret
string
""
Secret with initdb scripts
primary.initdb.user
string
""
PostgreSQL username to execute initdb scripts
primary.initdb.password
string
""
PostgreSQL password to execute initdb scripts
primary.preInitDb.scripts
object
{}
Dictionary of pre-init scripts
primary.preInitDb.scriptsConfigMap
string
""
ConfigMap with pre-init scripts
primary.preInitDb.scriptsSecret
string
""
Secret with pre-init scripts
primary.standby.enabled
boolean
false
Enable primary as standby of another cluster
primary.standby.primaryHost
string
""
Host of replication primary in other cluster
primary.standby.primaryPort
string
""
Port of replication primary in other cluster
primary.extraEnvVars
array
[]
Extra environment variables
primary.extraEnvVarsCM
string
""
ConfigMap with extra env vars
primary.extraEnvVarsSecret
string
""
Secret with extra env vars
primary.command
array
[]
Override default container command
primary.args
array
[]
Override default container args
Primary Health Check Parameters
Parameter
Type
Default
Description
primary.livenessProbe.enabled
boolean
true
Enable livenessProbe
primary.livenessProbe.initialDelaySeconds
number
30
Initial delay for livenessProbe
primary.livenessProbe.periodSeconds
number
10
Period seconds for livenessProbe
primary.livenessProbe.timeoutSeconds
number
5
Timeout seconds for livenessProbe
primary.livenessProbe.failureThreshold
number
6
Failure threshold for livenessProbe
primary.livenessProbe.successThreshold
number
1
Success threshold for livenessProbe
primary.readinessProbe.enabled
boolean
true
Enable readinessProbe
primary.readinessProbe.initialDelaySeconds
number
5
Initial delay for readinessProbe
primary.readinessProbe.periodSeconds
number
10
Period seconds for readinessProbe
primary.readinessProbe.timeoutSeconds
number
5
Timeout seconds for readinessProbe
primary.readinessProbe.failureThreshold
number
6
Failure threshold for readinessProbe
primary.readinessProbe.successThreshold
number
1
Success threshold for readinessProbe
primary.startupProbe.enabled
boolean
false
Enable startupProbe
primary.startupProbe.initialDelaySeconds
number
30
Initial delay for startupProbe
primary.startupProbe.periodSeconds
number
10
Period seconds for startupProbe
primary.startupProbe.timeoutSeconds
number
`
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 v2.3.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