hscloud/hswaw/site/prod.jsonnet
Radek Pietruszewski f5844311eb */kube: Add kube.SimpleIngress
Change-Id: Iddcac629b9938f228dd93b32e58bb14606d5c6e5
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1745
Reviewed-by: q3k <q3k@hackerspace.pl>
2023-10-28 17:55:48 +00:00

52 lines
1.5 KiB
Text

local kube = import "../../kube/hscloud.libsonnet";
{
local top = self,
local cfg = self.cfg,
cfg:: {
name: 'site',
namespace: 'site',
domains: [
'new.hackerspace.pl',
],
image: 'registry.k0.hswaw.net/q3k/hswaw-site@sha256:02414c9e7e0751abe7a8ad3ef1b1ccc35f1f89edf67a6f0b396b7a1d0c178f2b',
},
ns: kube.Namespace(cfg.namespace),
deployment: top.ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
replicas: 3,
template+: {
spec+: {
containers_: {
default: kube.Container("default") {
image: cfg.image,
command: [
"/hswaw/site/site",
"-logtostderr",
],
resources: {
requests: { cpu: "25m", memory: "64Mi" },
limits: { cpu: "500m", memory: "128Mi" },
},
ports_: {
http: { containerPort: 8080 },
},
},
},
},
},
},
},
service: top.ns.Contain(kube.Service(cfg.name)) {
target_pod:: top.deployment.spec.template,
},
ingress: top.ns.Contain(kube.SimpleIngress(cfg.name)) {
hosts:: cfg.domains,
target_service:: top.service,
},
}