blob: 7f1edc2fbd273b9501e19b9d56710c5c6ffacd5f [file] [log] [blame]
local kube = import "../../kube/hscloud.libsonnet";
{
local top = self,
local cfg = self.cfg,
cfg:: {
name: 'capacifier',
namespace: 'capacifier',
domain: 'capacifier.hackerspace.pl',
image: 'registry.k0.hswaw.net/q3k/capacifier@sha256:fd94b29bf711267235c96e5102ac4024e83e5851869a5e8814b83e76490c00af',
},
local ns = kube.Namespace(cfg.namespace),
deployment: ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
replicas: 3,
template+: {
spec+: {
containers_: {
default: kube.Container("default") {
image: cfg.image,
env_: {
LDAP_DN: "cn=capacifier,ou=Services,dc=hackerspace,dc=pl",
LDAP_PW: { secretKeyRef: { name: cfg.name, key: 'ldap_pw' } },
},
command: [
"/hswaw/capacifier/capacifier",
"-logtostderr",
"-api_listen", "0.0.0.0:8080",
"-ldap_bind_dn", "$(LDAP_DN)",
"-ldap_bind_pw", "$(LDAP_PW)",
],
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_service:: top.service,
},
}