| 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", }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| }, |
| } |
| } |