forked from hswaw/hscloud
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>master
parent
37991744d8
commit
0e12849717
|
@ -66,9 +66,8 @@ local postgres = import '../../kube/postgres_v.libsonnet';
|
|||
storageClass:: cfg.storageClassName,
|
||||
},
|
||||
|
||||
postgres: postgres {
|
||||
postgres: ns.Contain(postgres) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: cfg.name,
|
||||
storageClassName: cfg.storageClassName,
|
||||
version: '15.4',
|
||||
|
|
|
@ -118,10 +118,9 @@ local redis = import "../../../kube/redis.libsonnet";
|
|||
|
||||
# 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 @@ local redis = import "../../../kube/redis.libsonnet";
|
|||
},
|
||||
},
|
||||
|
||||
redis: redis {
|
||||
redis: ns.Contain(redis) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: "mastodon",
|
||||
storageClassName: "waw-hdd-redundant-3",
|
||||
prefix: "waw3-",
|
||||
|
|
|
@ -245,10 +245,9 @@ local coturn = import "./coturn.libsonnet";
|
|||
|
||||
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 @@ local coturn = import "./coturn.libsonnet";
|
|||
},
|
||||
} else {},
|
||||
|
||||
redis: redis {
|
||||
redis: ns.Contain(redis) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: "synapse",
|
||||
storageClassName: cfg.storageClassName,
|
||||
password: { secretKeyRef: { name: "synapse", key: "redis_password" } },
|
||||
|
|
|
@ -82,9 +82,8 @@ local postgres = import "../../../kube/postgres.libsonnet";
|
|||
|
||||
local ns = kube.Namespace(cfg.namespace),
|
||||
|
||||
postgres3: postgres {
|
||||
postgres3: ns.Contain(postgres) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: "synapse",
|
||||
database: "synapse",
|
||||
username: "synapse",
|
||||
|
|
|
@ -51,9 +51,8 @@ local postgres = import "../../kube/postgres.libsonnet";
|
|||
|
||||
local ns = kube.Namespace(cfg.namespace),
|
||||
|
||||
postgres: postgres {
|
||||
postgres: ns.Contain(postgres) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: "redmine",
|
||||
database: "redmine",
|
||||
username: "redmine",
|
||||
|
|
|
@ -38,9 +38,8 @@ local redis = import "../../kube/redis.libsonnet";
|
|||
|
||||
local ns = kube.Namespace(cfg.namespace),
|
||||
|
||||
redis: redis {
|
||||
redis: ns.Contain(redis) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
storageClassName: cfg.storageClassName,
|
||||
appName: "paperless",
|
||||
image: "redis:6.0",
|
||||
|
@ -48,9 +47,8 @@ local redis = import "../../kube/redis.libsonnet";
|
|||
},
|
||||
},
|
||||
|
||||
postgres: postgres {
|
||||
postgres: ns.Contain(postgres) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: "paperless",
|
||||
database: "paperless",
|
||||
username: "paperless",
|
||||
|
|
|
@ -38,9 +38,8 @@ local postgres = import '../../kube/postgres.libsonnet';
|
|||
},
|
||||
},
|
||||
|
||||
postgres: postgres {
|
||||
postgres: ns.Contain(postgres) {
|
||||
cfg+: {
|
||||
namespace: cfg.namespace,
|
||||
appName: 'ferretdb-postgres',
|
||||
database: 'ferretdb',
|
||||
username: 'username',
|
||||
|
|
Loading…
Reference in New Issue