personal/radex/demo-next: add volume mount demo
Change-Id: I992d089c8d345e87667bf4040086a28b2096cc35
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1574
diff --git a/personal/radex/demo-next/prod.jsonnet b/personal/radex/demo-next/prod.jsonnet
index 5f89762..dce74b9 100644
--- a/personal/radex/demo-next/prod.jsonnet
+++ b/personal/radex/demo-next/prod.jsonnet
@@ -6,7 +6,7 @@
cfg:: {
name: "demo-next",
- image: "registry.k0.hswaw.net/radex/next-bruh:v1",
+ image: "registry.k0.hswaw.net/radex/next-bruh:v2",
domain: "demo-next.hs.radex.io",
},
@@ -14,9 +14,12 @@
deployment: top.ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
- replicas: 3,
+ replicas: 1,
template+: {
spec+: {
+ volumes_: {
+ data: kube.PersistentVolumeClaimVolume(top.data),
+ },
containers_: {
default: kube.Container("default") {
image: cfg.image,
@@ -24,9 +27,15 @@
requests: { cpu: "0.01", memory: "64M" },
limits: { cpu: "1", memory: "256M" },
},
+ env_: {
+ DATA_PATH: "/data",
+ },
ports_: {
http: { containerPort: 3000 },
},
+ volumeMounts_: {
+ data: { mountPath: '/data' },
+ }
},
},
},
@@ -34,6 +43,17 @@
},
},
+ data: top.ns.Contain(kube.PersistentVolumeClaim("data")) {
+ spec+: {
+ storageClassName: "waw-hdd-redundant-3",
+ accessModes: [ "ReadWriteOnce" ],
+ resources: {
+ requests: {
+ storage: "1Gi",
+ },
+ },
+ },
+ },
service: top.ns.Contain(kube.Service(cfg.name)) {
target_pod:: top.deployment.spec.template,
},