kube/postgres: expose cfg.initdbArgs

This option allows easy customization of certain initial database
properties, like encoding or collation. See:
https://www.postgresql.org/docs/9.5/app-initdb.html

Adding this option in already existing deployments will only cause
postgres pod restart, but no data loss or schema changes!

Intended to be used in further matrix deployment cleanups.

Change-Id: I49a017c21a228f983bea6bafa7dac962a75d05c9
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" },
                             },