| 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", |
| }, |
| |
| ns: kube.Namespace("personal-radex"), |
| |
| deployment: top.ns.Contain(kube.Deployment(cfg.name)) { |
| spec+: { |
| replicas: 1, |
| template+: { |
| spec+: { |
| volumes_: { |
| data: kube.PersistentVolumeClaimVolume(top.data), |
| }, |
| 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: top.ns.Contain(kube.PersistentVolumeClaim("data")) { |
| storage: "1Gi", |
| spec+: { |
| storageClassName: "waw-hdd-redundant-3", |
| }, |
| }, |
| service: top.ns.Contain(kube.Service(cfg.name)) { |
| target:: top.deployment, |
| }, |
| |
| ingress: top.ns.Contain(kube.SimpleIngress(cfg.name)) { |
| hosts:: [cfg.domain], |
| target_service:: top.service, |
| }, |
| } |