blob: 84f2f6e0fdf073056b74cac3e0e31db5bf67b078 [file] [log] [blame]
local kube = import '../../../kube/hscloud.libsonnet';
{
local annoyatron = self,
local cfg = self.cfg,
cfg:: {
image: "derq3k/card10-annoyatron:latest",
domain: "annoyatron-prod.q3k.org",
},
deploy: kube.Deployment("annoyatron") {
metadata+: {
namespace: "q3k",
},
spec+: {
template+: {
spec+: {
containers_: {
annoyatron: kube.Container("annoyatron") {
image: cfg.image,
env_: {
TOKEN: {
secretKeyRef: { name: "annoyatron-token", key: "token" },
},
},
command: [
"/app/annoyatron",
"-token=$(TOKEN)",
],
ports_: {
client: { containerPort: 8080 },
},
},
},
},
},
},
},
svc: kube.Service("annoyatron") {
metadata+: {
namespace: "q3k",
},
target_pod:: annoyatron.deploy.spec.template,
spec+: {
ports: [
{ name: "client", port: 8080, targetPort: 8080, protocol: "TCP" },
],
},
},
ingress: kube.SimpleIngress("annoyatron") {
metadata+: {
namespace: "q3k",
},
hosts:: [cfg.domain],
target_service:: annoyatron.svc,
},
}