Restart homepage deployment on config change
Some checks failed
Lint / lint (push) Failing after 1m47s

This commit is contained in:
Gabriel Simmer 2024-01-08 17:08:31 +00:00
parent 59e449dd75
commit d4772acd38
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
2 changed files with 287 additions and 264 deletions

View file

@ -1,4 +1,9 @@
{ lib, ... }: {
kubernetes.resourceOrder =
[ "CustomResourceDefinition"
"Namespace"
"ConfigMap"
];
kubernetes.customTypes = [
{
name = "servicemonitors";

View file

@ -1,42 +1,5 @@
{ lib, config, kubenix, ... }: {
kubernetes.helm.releases.homepage = {
chart = kubenix.lib.helm.fetch {
repo = "https://jameswynn.github.io/helm-charts";
chart = "homepage";
version = "1.2.3";
sha256 = "sha256-tZv/+ePFPifilp8wU4FjogSJhNEERx0PcdHUzsBxfRA=";
};
# arbitrary attrset passed as values to the helm release
values = {
replicaCount = 2;
image = {
repository = "ghcr.io/gethomepage/homepage";
tag = "latest";
};
serviceAccount.create = true;
enableRbac = true;
ingress.main = {
enabled = true;
ingressClassName = "nginx";
hosts = [
{
host = "home.gmem.ca";
paths = [
{
path = "/";
pathType = "Prefix";
}
];
}
];
tls = [
{
hosts = [ "home.gmem.ca" ];
secretName = "gmem-ca-wildcard";
}
];
};
config = {
{ lib, config, kubenix, ... }:
let homepage-config = {
bookmarks = [];
services = [
{
@ -108,7 +71,7 @@
}
{ NextDNS = {
icon = "nextdns.png";
href = "https://my.nextdns.io";
href = "https://my.nextdns.io/bcee89/setup";
description = "DNS provider";
widget = {
type = "nextdns";
@ -117,10 +80,10 @@
};
};
}
{ "Proxmox Homelab" = {
{ "Proxmox" = {
icon = "proxmox.png";
href = "https://proxmox.gmem.ca";
description = "Homelabe proxmox";
description = "Homelab proxmox";
widget = {
type = "proxmox";
url = "https://proxmox.gmem.ca";
@ -140,6 +103,17 @@
};
};
}
{ "NextDNS Tailscale" = {
icon = "nextdns.png";
href = "https://my.nextdns.io/74c6db/setup";
description = "Tailnet DNS provider";
widget = {
type = "nextdns";
profile = "74c6db";
key = "{{HOMEPAGE_VAR_NEXTDNS_KEY}}";
};
};
}
];
}
{
@ -298,11 +272,55 @@
}
];
};
in
{
kubernetes.helm.releases.homepage = {
chart = kubenix.lib.helm.fetch {
repo = "https://jameswynn.github.io/helm-charts";
chart = "homepage";
version = "1.2.3";
sha256 = "sha256-tZv/+ePFPifilp8wU4FjogSJhNEERx0PcdHUzsBxfRA=";
};
# arbitrary attrset passed as values to the helm release
values = {
replicaCount = 2;
image = {
repository = "ghcr.io/gethomepage/homepage";
tag = "latest";
};
serviceAccount.create = true;
enableRbac = true;
config = homepage-config;
ingress.main = {
enabled = true;
ingressClassName = "nginx";
hosts = [
{
host = "home.gmem.ca";
paths = [
{
path = "/";
pathType = "Prefix";
}
];
}
];
tls = [
{
hosts = [ "home.gmem.ca" ];
secretName = "gmem-ca-wildcard";
}
];
};
};
};
kubernetes.resources.deployments.homepage = {
metadata.namespace = "default";
spec.template.spec.containers.homepage.envFrom = [ { secretRef.name = "homepage-config"; } ];
spec.template = {
metadata.annotations."gmem.ca/homepage-config-hash" = (builtins.hashString "md5" (builtins.toJSON homepage-config));
spec.containers.homepage.envFrom = [ { secretRef.name = "homepage-config"; } ];
};
};
}