forked from hswaw/hscloud
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
|
local kube = import "../../../kube/kube.libsonnet";
|
||
|
|
||
|
{
|
||
|
local top = self,
|
||
|
local cfg = self.cfg,
|
||
|
|
||
|
cfg:: {
|
||
|
name: "demo",
|
||
|
image: "crccheck/hello-world",
|
||
|
domain: "demo.hs.radex.io",
|
||
|
},
|
||
|
|
||
|
ns: kube.Namespace("personal-radex"),
|
||
|
|
||
|
deployment: top.ns.Contain(kube.Deployment(cfg.name)) {
|
||
|
spec+: {
|
||
|
replicas: 3,
|
||
|
template+: {
|
||
|
spec+: {
|
||
|
containers_: {
|
||
|
default: kube.Container("default") {
|
||
|
image: cfg.image,
|
||
|
resources: {
|
||
|
requests: { cpu: "0.01", memory: "64M" },
|
||
|
limits: { cpu: "1", memory: "256M" },
|
||
|
},
|
||
|
ports_: {
|
||
|
http: { containerPort: 8000 },
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
|
||
|
service: top.ns.Contain(kube.Service(cfg.name)) {
|
||
|
target_pod:: top.deployment.spec.template,
|
||
|
},
|
||
|
|
||
|
ingress: top.ns.Contain(kube.Ingress(cfg.name)) {
|
||
|
spec+: {
|
||
|
rules: [
|
||
|
{
|
||
|
host: cfg.domain,
|
||
|
http: {
|
||
|
paths: [
|
||
|
{ path: "/", backend: top.service.name_port },
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
}
|
||
|
}
|