blob: 1d2b920d962091a4357f0ba8c5a3d2f8561bc7b5 [file] [log] [blame]
local kube = import "../../kube/hscloud.libsonnet";
local hspki = import "../../kube/hspki.libsonnet";
{
local top = self,
local cfg = self.cfg,
cfg:: {
name: 'hackdoc',
namespace: 'hackdoc',
domain: 'hackdoc.hackerspace.pl',
depotviewUrl: 'depotview.depotview.svc.cluster.local:4200',
image: 'registry.k0.hswaw.net/q3k/hackdoc:315532800-f4d02581f60b18a8635d026079ed67039cdc45e6',
},
local ns = kube.Namespace(cfg.namespace),
deployment: ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
replicas: 1,
template+: {
spec+: top.pki.PodSpec {
containers_: {
default: top.pki.GoContainer("default") {
image: cfg.image,
executable_: "/devtools/hackdoc",
command+: [
"-depotview=%s" % [cfg.depotviewUrl],
"-hackdoc_url=https://%s" % [cfg.domain],
"-pub_listen=0.0.0.0:8080",
],
resources: {
requests: { cpu: "25m", memory: "64Mi" },
limits: { cpu: "500m", memory: "128Mi" },
},
ports_: {
http: { containerPort: 8080 },
},
},
},
},
},
},
},
service: ns.Contain(kube.Service(cfg.name)) {
target:: top.deployment,
},
ingress: ns.Contain(kube.SimpleIngress(cfg.name)) {
hosts:: [cfg.domain],
target:: top.service,
},
pki: ns.Contain(hspki) {
cfg+: {
name: cfg.name,
}
},
}