Merge "kube/postgres: expose cfg.initdbArgs"
diff --git a/kube/postgres.libsonnet b/kube/postgres.libsonnet
index e89e9db..a80c236 100644
--- a/kube/postgres.libsonnet
+++ b/kube/postgres.libsonnet
@@ -18,6 +18,12 @@
password: error "password must be set",
storageSize: "30Gi",
+
+ # This option can be used to customize initial database creation. For
+ # available options see: https://www.postgresql.org/docs/9.5/app-initdb.html
+ # Changing this option in already existing deployments will not affect
+ # existing database.
+ initdbArgs: null,
},
makeName(suffix):: cfg.prefix + suffix,
@@ -63,7 +69,9 @@
POSTGRES_USER: cfg.username,
POSTGRES_PASSWORD: cfg.password,
PGDATA: "/var/lib/postgresql/data/pgdata",
- },
+ } + if cfg.initdbArgs != null then {
+ POSTGRES_INITDB_ARGS: cfg.initdbArgs,
+ } else {},
volumeMounts_: {
data: { mountPath: "/var/lib/postgresql/data" },
},