kube: use ns.Contain() for postgres and redis

This is purely for consistency. While it's objectively more "magic" than the previous convention, newcomers may be asking themselves how come namespace is passed to kube objects using ns.Contain(), but to these custom objects via cfg.namespace.

Change-Id: I061c27c74213d5481b2c7e0afd5f316e84335786
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1808
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/app/inventory/prod.jsonnet b/app/inventory/prod.jsonnet
index 0389223..d54ba9d 100644
--- a/app/inventory/prod.jsonnet
+++ b/app/inventory/prod.jsonnet
@@ -66,9 +66,8 @@
     storageClass:: cfg.storageClassName,
   },
 
-  postgres: postgres {
+  postgres: ns.Contain(postgres) {
     cfg+: {
-      namespace: cfg.namespace,
       appName: cfg.name,
       storageClassName: cfg.storageClassName,
       version: '15.4',
diff --git a/app/mastodon/kube/mastodon.libsonnet b/app/mastodon/kube/mastodon.libsonnet
index 06c9fe1..6e2d0ee 100644
--- a/app/mastodon/kube/mastodon.libsonnet
+++ b/app/mastodon/kube/mastodon.libsonnet
@@ -118,10 +118,9 @@
 
     # there used to be a nonversioned postgres (10.4) here
     # at time of writing it exists in prod, scaled down to 0, to preserve the PVC
-    postgres: postgres {
+    postgres: ns.Contain(postgres) {
         cfg+: {
             version: "13.9",
-            namespace: cfg.namespace,
             appName: "mastodon",
             database: "mastodon",
             username: "mastodon",
@@ -133,9 +132,8 @@
         },
     },
 
-    redis: redis {
+    redis: ns.Contain(redis) {
         cfg+: {
-            namespace: cfg.namespace,
             appName: "mastodon",
             storageClassName: "waw-hdd-redundant-3",
             prefix: "waw3-",
diff --git a/app/matrix/lib/matrix-ng.libsonnet b/app/matrix/lib/matrix-ng.libsonnet
index 44e97a9..eb08935 100644
--- a/app/matrix/lib/matrix-ng.libsonnet
+++ b/app/matrix/lib/matrix-ng.libsonnet
@@ -245,10 +245,9 @@
 
     local ns = kube.Namespace(cfg.namespace),
 
-    postgres3: if cfg.postgres.enable then postgres {
+    postgres3: if cfg.postgres.enable then ns.Contain(postgres) {
         local psql = self,
         cfg+: {
-            namespace: cfg.namespace,
             appName: "synapse",
             database: "synapse",
             username: "synapse",
@@ -271,9 +270,8 @@
         },
     } else {},
 
-    redis: redis {
+    redis: ns.Contain(redis) {
         cfg+: {
-            namespace: cfg.namespace,
             appName: "synapse",
             storageClassName: cfg.storageClassName,
             password: { secretKeyRef: { name: "synapse", key: "redis_password" } },
diff --git a/app/matrix/lib/matrix.libsonnet b/app/matrix/lib/matrix.libsonnet
index c17a934..462a77d 100644
--- a/app/matrix/lib/matrix.libsonnet
+++ b/app/matrix/lib/matrix.libsonnet
@@ -82,9 +82,8 @@
 
     local ns = kube.Namespace(cfg.namespace),
 
-    postgres3: postgres {
+    postgres3: ns.Contain(postgres) {
         cfg+: {
-            namespace: cfg.namespace,
             appName: "synapse",
             database: "synapse",
             username: "synapse",