Playing around with gethomepage

Change-Id: I96e69f31eb90c017500ee5450b06e30bb9e068da
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1882
changes/82/1882/3
viq 2024-01-28 23:29:52 +01:00
parent 6c6fda3076
commit 9340a3933d
1 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,129 @@
local kube = import "../../../kube/hscloud.libsonnet";
{
local top = self,
local cfg = self.cfg,
cfg:: {
name: "gethomepage",
namespace: "personal-viq",
},
local ns = kube.Namespace(cfg.namespace),
configMap: kube.ConfigMap("config") {
local cm = self,
metadata+: {
namespace: cfg.namespace,
},
data: {
"settings.yaml": std.manifestJson({
logpath: "/logs",
}),
"custom.css": "",
"custom.js": "",
"docker.yaml": "",
"kubernetes.yaml": std.manifestYamlDoc({
mode: "cluster",
}),
"bookmarks.yaml": "",
// "bookmarks.yaml": std.manifestYamlDoc({
// bookmarks: [
// {
// Documentation: [
// {
// hswiki: { abbr: "wiki", href: "https://wiki.hackerspace.pl" },
// sourcegraph: { abbr: "CS", href: "https://cs.hackerspace.pl" },
// }
// ],
// }
// ],
// }),
"services.yaml": std.manifestJson([
{
Documentation: [
{
Wiki: { href: "https://wiki.hackerspace.pl", siteMonitor: "https://wiki.hackerspace.pl" },
},
{
SourceGraph: { href: "https://cs.hackerspace.pl", siteMonitor: "https://cs.hackerspace.pl" },
},
],
},
]),
"widgets.yaml": std.manifestJson([
{
kubernetes: {
cluster: {
show: "true",
cpu: "true",
memory: "true",
showLabel: "true",
label: "hscloud k0",
},
nodes: {
show: "true",
cpu: true,
memory: true,
showLabel: true,
},
},
},
{
datetime: {
text_size: "xl",
locale: "en-DK",
format: {
hourCycle: "h23",
timeStyle: "long",
dateStyle: "long",
},
},
},
{
openmeteo: {
label: "Warsaw",
timezone: "Europe/Warsaw",
units: "metric",
cache: "5",
latitude: "52.24160",
longitude: "20.98485",
},
},
]),
},
},
deployment: ns.Contain(kube.Deployment(cfg.name)) {
spec+: {
replicas: 1,
template+: {
spec+: {
volumes_: {
config: top.configMap.volume,
logs: {
emptyDir: {},
},
},
containers_: {
default: kube.Container("default") {
image: "ghcr.io/gethomepage/homepage:latest",
resources: {
requests: { cpu: "50m", memory: "128M" },
limits: { cpu: "750m", memory: "256M" },
},
ports_: {
http: { containerPort: 3000 },
},
volumeMounts_: {
//config: { mountPath: "/app/config/services.yaml", subPath: "services.yaml"},
config: { mountPath: "/app/config", },
logs: { mountPath: "/logs", },
},
},
},
},
},
},
}
}