blob: feeace1a802e324b1b3d71ca0c269244d43d8abb [file] [log] [blame]
Radek Pietruszewskif5844312023-10-27 22:41:18 +02001local kube = import "../../kube/hscloud.libsonnet";
radexb8d4a8a2023-09-22 23:46:05 +02002
3{
4 local top = self,
5 local cfg = self.cfg,
6
7 cfg:: {
8 name: 'ldapweb',
9 namespace: 'ldapweb',
10 domain: 'profile.hackerspace.pl',
radex6e0041d2023-11-23 20:41:15 +010011 image: 'registry.k0.hswaw.net/radex/ldapweb:20231123203042',
radex401aa5e2023-10-13 22:11:43 +020012 },
13
radex1439fde2023-11-24 12:22:22 +010014 secretRefs:: {
radex401aa5e2023-10-13 22:11:43 +020015 admin_password: { secretKeyRef: { name: cfg.name, key: 'admin_password' } },
radex6e0041d2023-11-23 20:41:15 +010016 smtp_password: { secretKeyRef: { name: cfg.name, key: 'smtp_password' } },
radexb8d4a8a2023-09-22 23:46:05 +020017 },
18
radex99ed6a72023-11-24 11:42:55 +010019 local ns = kube.Namespace(cfg.namespace),
radexb8d4a8a2023-09-22 23:46:05 +020020
radex99ed6a72023-11-24 11:42:55 +010021 deployment: ns.Contain(kube.Deployment(cfg.name)) {
radexb8d4a8a2023-09-22 23:46:05 +020022 spec+: {
23 replicas: 1,
24 template+: {
25 spec+: {
radexb8d4a8a2023-09-22 23:46:05 +020026 containers_: {
27 default: kube.Container("default") {
28 image: cfg.image,
29 resources: {
radex401aa5e2023-10-13 22:11:43 +020030 requests: { cpu: "25m", memory: "256Mi" },
31 limits: { cpu: "500m", memory: "512Mi" },
radexb8d4a8a2023-09-22 23:46:05 +020032 },
33 ports_: {
34 http: { containerPort: 8000 },
35 },
radexd60a68d2023-09-23 18:34:02 +020036 env_: {
37 LDAPWEB_ADMIN_GROUPS: 'ldap-admin,staff,zarzad',
38 LDAPWEB_ACTIVE_GROUPS: 'fatty,starving,potato',
radex401aa5e2023-10-13 22:11:43 +020039 LDAPWEB_ADMIN_DN: 'cn=ldapweb,ou=services,dc=hackerspace,dc=pl',
radex1439fde2023-11-24 12:22:22 +010040 LDAPWEB_ADMIN_PASSWORD: top.secretRefs.admin_password,
radex6e0041d2023-11-23 20:41:15 +010041 LDAPWEB_PROTECTED_GROUPS: 'ldap-admin,staff,zarzad',
42 LDAPWEB_SMTP_USER: 'ldapweb',
radex1439fde2023-11-24 12:22:22 +010043 LDAPWEB_SMTP_PASSWORD: top.secretRefs.smtp_password,
radex6e0041d2023-11-23 20:41:15 +010044 LDAPWEB_PAPERTRAIL_RECIPIENTS: 'zarzad@hackerspace.pl',
radex401aa5e2023-10-13 22:11:43 +020045 LDAPWEB_AVATAR_CACHE_TIMEOUT: '1800',
radexb8d4a8a2023-09-22 23:46:05 +020046 }
47 },
48 },
49 },
50 },
51 },
52 },
53
radex99ed6a72023-11-24 11:42:55 +010054 service: ns.Contain(kube.Service(cfg.name)) {
radex8b8f3872023-11-24 11:09:46 +010055 target:: top.deployment,
radexb8d4a8a2023-09-22 23:46:05 +020056 },
57
radex99ed6a72023-11-24 11:42:55 +010058 ingress: ns.Contain(kube.SimpleIngress(cfg.name)) {
Radek Pietruszewskif5844312023-10-27 22:41:18 +020059 hosts:: [cfg.domain],
radexd45584a2023-11-24 12:51:57 +010060 target:: top.service,
radexb8d4a8a2023-09-22 23:46:05 +020061 },
radexb8d4a8a2023-09-22 23:46:05 +020062}