1
0
Fork 0

kube/postgres: add extra options configuration option

Change-Id: I674740872d9540329711cad2b05007215f90bd9b
master
informatic 2021-02-08 22:44:56 +01:00
parent 0572fff9a4
commit 3b8f6675b1
1 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,11 @@ local kube = import "kube.libsonnet";
# Changing this option in already existing deployments will not affect
# existing database.
initdbArgs: null,
# Extra postgres configuration options passed on startup. Accepts only
# string values.
# Example: { max_connections: "300" }
opts: {},
},
makeName(suffix):: cfg.prefix + suffix,
@ -72,6 +77,12 @@ local kube = import "kube.libsonnet";
} + if cfg.initdbArgs != null then {
POSTGRES_INITDB_ARGS: cfg.initdbArgs,
} else {},
args: std.flatMap(
function(k) ["-c", "%s=%s" % [k, cfg.opts[k]]],
std.objectFields(cfg.opts),
),
volumeMounts_: {
data: { mountPath: "/var/lib/postgresql/data" },
},