personal/radex/demo-next: add volume mount demo

Change-Id: I992d089c8d345e87667bf4040086a28b2096cc35
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1574
This commit is contained in:
radex 2023-08-15 18:07:28 +02:00
parent dba676d7a8
commit 5365e7e12c

View file

@ -6,7 +6,7 @@ local kube = import "../../../kube/kube.libsonnet";
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 @@ local kube = import "../../../kube/kube.libsonnet";
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 @@ local kube = import "../../../kube/kube.libsonnet";
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 @@ local kube = import "../../../kube/kube.libsonnet";
},
},
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,
},