4
0
Fork 2
mirror of https://gerrit.hackerspace.pl/hscloud synced 2025-02-16 09:46:45 +00:00

Merge "kube/postgres: add extra options configuration option"

This commit is contained in:
informatic 2021-02-09 08:34:48 +00:00 committed by Gerrit Code Review
commit 1f717993e5

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" },
},