2023-10-27 20:41:18 +00:00
|
|
|
local kube = import "../../kube/hscloud.libsonnet";
|
2023-09-22 21:46:05 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
local top = self,
|
|
|
|
local cfg = self.cfg,
|
|
|
|
|
|
|
|
cfg:: {
|
|
|
|
name: 'ldapweb',
|
|
|
|
namespace: 'ldapweb',
|
|
|
|
domain: 'profile.hackerspace.pl',
|
2023-10-28 13:42:16 +00:00
|
|
|
image: 'registry.k0.hswaw.net/radex/ldapweb:1698604668',
|
2023-10-13 20:11:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
secrets:: {
|
|
|
|
admin_password: { secretKeyRef: { name: cfg.name, key: 'admin_password' } },
|
2023-09-22 21:46:05 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
ns: kube.Namespace(cfg.namespace),
|
|
|
|
|
|
|
|
deployment: top.ns.Contain(kube.Deployment(cfg.name)) {
|
|
|
|
spec+: {
|
|
|
|
replicas: 1,
|
|
|
|
template+: {
|
|
|
|
spec+: {
|
|
|
|
containers_: {
|
|
|
|
default: kube.Container("default") {
|
|
|
|
image: cfg.image,
|
|
|
|
resources: {
|
2023-10-13 20:11:43 +00:00
|
|
|
requests: { cpu: "25m", memory: "256Mi" },
|
|
|
|
limits: { cpu: "500m", memory: "512Mi" },
|
2023-09-22 21:46:05 +00:00
|
|
|
},
|
|
|
|
ports_: {
|
|
|
|
http: { containerPort: 8000 },
|
|
|
|
},
|
2023-09-23 16:34:02 +00:00
|
|
|
env_: {
|
|
|
|
LDAPWEB_ADMIN_GROUPS: 'ldap-admin,staff,zarzad',
|
|
|
|
LDAPWEB_ACTIVE_GROUPS: 'fatty,starving,potato',
|
2023-10-13 20:11:43 +00:00
|
|
|
LDAPWEB_ADMIN_DN: 'cn=ldapweb,ou=services,dc=hackerspace,dc=pl',
|
|
|
|
LDAPWEB_ADMIN_PASSWORD: top.secrets.admin_password,
|
|
|
|
LDAPWEB_AVATAR_CACHE_TIMEOUT: '1800',
|
2023-09-22 21:46:05 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
service: top.ns.Contain(kube.Service(cfg.name)) {
|
|
|
|
target_pod:: top.deployment.spec.template,
|
|
|
|
},
|
|
|
|
|
2023-10-27 20:41:18 +00:00
|
|
|
ingress: top.ns.Contain(kube.SimpleIngress(cfg.name)) {
|
|
|
|
hosts:: [cfg.domain],
|
|
|
|
target_service:: top.service,
|
2023-09-22 21:46:05 +00:00
|
|
|
},
|
|
|
|
}
|