4
0
Fork 2
mirror of https://gerrit.hackerspace.pl/hscloud synced 2025-01-19 20:23:53 +00:00

hswaw/blog: added blog prod.jsonnet

Change-Id: I095d47ef84f4eeace52e8ec9dc831a59db94685a
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/2042
Reviewed-by: informatic <informatic@hackerspace.pl>
Reviewed-by: radex <radex@hackerspace.pl>
This commit is contained in:
krnlexception 2024-11-06 20:36:42 +01:00
parent ae72f60b1c
commit 85204f6d5b
4 changed files with 75 additions and 0 deletions

View file

@ -402,6 +402,7 @@ local admins = import "lib/admins.libsonnet";
{ namespace: "pretalx", dns: "cfp.cebula.camp" },
{ namespace: "site", dns: "new.hackerspace.pl" },
{ namespace: "teleimg", dns: "teleimg.hswaw.net" },
{ namespace: "blog", dns: "blog.hackerspace.pl" },
// ops
{ namespace: "sso", dns: "sso.hackerspace.pl" },
@ -519,6 +520,9 @@ local admins = import "lib/admins.libsonnet";
"teleimg": [
"radex",
],
"blog": [
"krnlexception",
],
// in-cluster prometheus
"monitoring-cluster": [
"viq",

3
hswaw/blog/README.md Normal file
View file

@ -0,0 +1,3 @@
# Warsaw Hackerspace blog
Source: https://code.hackerspace.pl/hswaw/hsblog

View file

@ -0,0 +1,11 @@
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
absolute_redirect off;
}

57
hswaw/blog/prod.jsonnet Normal file
View file

@ -0,0 +1,57 @@
local kube = import "../../kube/hscloud.libsonnet";
{
local top = self,
local cfg = top.cfg,
cfg:: {
name: 'hsblog',
namespace: 'blog',
domain: 'blog.hackerspace.pl',
image: 'registry.k0.hswaw.net/krnlexception/hsblog:20241124',
},
local ns = kube.Namespace(cfg.namespace),
deployment: ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
template+: {
spec+: {
containers_: {
default: kube.Container('default') {
image: cfg.image,
ports_: {
http: { containerPort: 8080 },
},
volumeMounts: [
{
name: 'config',
subPath: 'default.conf',
mountPath: '/etc/nginx/conf.d/default.conf'
},
],
},
},
volumes_: {
config: top.config.volume,
}
}
}
}
},
config: ns.Contain(kube.ConfigMap(cfg.name + '-config')) {
data: {
'default.conf': importstr 'nginx.default.conf',
},
},
service: ns.Contain(kube.Service(cfg.name)) {
target:: top.deployment,
},
ingress: ns.Contain(kube.SimpleIngress(cfg.name)) {
hosts:: [cfg.domain],
target:: top.service,
}
}