blob: 343209f923936cbe88acaf089e32b911c07141ad [file] [log] [blame]
Serge Bazanski0aa29102023-04-01 23:18:05 +00001local mirko = import "../../kube/mirko.libsonnet";
2local kube = import "../../kube/kube.libsonnet";
3
4{
5 cfg:: {
6 ldapBindPassword: error "ldapBindPassword must be set!",
7 image: "registry.k0.hswaw.net/q3k/capacifier:1680390588",
8 fqdn: "capacifier.hackerspace.pl",
9 },
10
11 component(cfg, env):: mirko.Component(env, "capacifier") {
12 local capacifier = self,
13 cfg+: {
14 image: cfg.image,
15 container: capacifier.GoContainer("main", "/hswaw/capacifier/capacifier") {
16 env_: {
17 BIND_PW: kube.SecretKeyRef(capacifier.secret, "bindPW"),
18 },
19 command+: [
20 "-listen", "0.0.0.0:5000",
21 "-ldap_bind_pw", "$(BIND_PW)",
22 ],
23 },
24 ports+: {
25 publicHTTP: {
26 api: {
27 port: 5000,
28 dns: cfg.fqdn,
29 }
30 },
31 },
32 },
33
34 secret: kube.Secret("capacifier") {
35 metadata+: capacifier.metadata,
36 data_: {
37 bindPW: cfg.ldapBindPassword,
38 },
39 },
40 },
41}