blob: e743a960e21ae1ecea774bbf1d97a1c8c2f688a9 [file] [log] [blame]
local kube = import "../../../kube/hscloud.libsonnet";
{
local top = self,
local cfg = self.cfg,
cfg:: {
name: "demo-next",
image: "registry.k0.hswaw.net/radex/next-bruh:v2",
domain: "demo-next.hs.radex.io",
},
local ns = kube.Namespace("personal-radex"),
deployment: ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
replicas: 1,
template+: {
spec+: {
volumes_: {
data: top.data.volume,
},
containers_: {
default: kube.Container("default") {
image: cfg.image,
resources: {
requests: { cpu: "0.01", memory: "64M" },
limits: { cpu: "1", memory: "256M" },
},
env_: {
DATA_PATH: "/data",
},
ports_: {
http: { containerPort: 3000 },
},
volumeMounts_: {
data: { mountPath: '/data' },
}
},
},
},
},
},
},
data: ns.Contain(kube.PersistentVolumeClaim("data")) {
storage:: "1Gi",
storageClass:: "waw-hdd-redundant-3",
},
service: ns.Contain(kube.Service(cfg.name)) {
target:: top.deployment,
},
ingress: ns.Contain(kube.SimpleIngress(cfg.name)) {
hosts:: [cfg.domain],
target:: top.service,
},
}