Merge "kube/redis: implement optional cfg.password option"

This commit is contained in:
informatic 2020-10-10 18:40:37 +00:00 committed by Gerrit Code Review
commit 7e3447f3ff

View file

@ -12,6 +12,7 @@ local kube = import "kube.libsonnet";
appName: error "app name must be set",
storageClassName: "waw-hdd-redundant-1",
prefix: "", # if set, should be 'foo-'
password: null,
image: "redis:5.0.4-alpine",
resources: {
@ -65,13 +66,16 @@ local kube = import "kube.libsonnet";
args: [
"redis-server",
"--appendonly", "yes",
],
] + (if cfg.password != null then ["--requirepass", "$(REDIS_PASSWORD)"] else []),
ports_: {
client: { containerPort: 6379 },
},
volumeMounts_: {
data: { mountPath: "/data" },
},
env_: {
[if cfg.password != null then "REDIS_PASSWORD"]: cfg.password,
},
resources: cfg.resources,
},
},