convert inbucket to kubernetes deployment

This commit is contained in:
Pim Kunis 2024-03-28 20:27:36 +01:00
parent b4805c028c
commit 41a5ed9dc5
5 changed files with 82 additions and 1 deletions

View file

@ -6,7 +6,6 @@
- {role: forgejo, tags: forgejo}
- {role: radicale, tags: radicale}
- {role: hedgedoc, tags: hedgedoc}
- {role: inbucket, tags: inbucket}
- {role: swarm_dashboard, tags: swarm_dashboard}
- {role: pihole, tags: pihole}
- {role: nextcloud, tags: nextcloud}

View file

@ -66,6 +66,12 @@ services:
- traefik.http.routers.freshrss.rule=Host(`rss.kun.is`)
- traefik.http.routers.freshrss.tls=true
- traefik.http.routers.freshrss.tls.certresolver=letsencrypt
- traefik.http.routers.inbucket.entrypoints=localsecure
- traefik.http.routers.inbucket.service=k3s@file
- traefik.http.routers.inbucket.rule=Host(`inbucket.kun.is`)
- traefik.http.routers.inbucket.tls=true
- traefik.http.routers.inbucket.tls.certresolver=letsencrypt
volumes:
- type: bind
source: /var/run/docker.sock

View file

@ -10,6 +10,7 @@
./freshrss.nix
./cyberchef.nix
./kms.nix
./inbucket.nix
];
kubernetes.kubeconfig = "~/.kube/config";
kubenix.project = "home";

View file

@ -7,6 +7,7 @@
PUBLISHED_PORT = "443";
};
# TODO: encrypt this with sops and commit to git repo.
secrets.freshrss.stringData.adminPassword = "ref+file:///home/pim/.config/home/vals.yaml";
deployments.freshrss = {

View file

@ -0,0 +1,74 @@
{
kubernetes.resources = {
deployments.inbucket = {
metadata.labels.app = "inbucket";
spec = {
selector.matchLabels.app = "inbucket";
template = {
metadata.labels.app = "inbucket";
spec = {
containers.inbucket = {
image = "inbucket/inbucket:edge";
# TODO: investigate the use of named ports.
ports = [
{
containerPort = 9000;
protocol = "TCP";
}
{
containerPort = 2500;
protocol = "TCP";
}
];
};
};
};
};
};
services = {
inbucket-web.spec = {
selector.app = "inbucket";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 9000;
}];
};
inbucket-email.spec = {
type = "LoadBalancer";
loadBalancerIP = "192.168.30.130";
selector.app = "inbucket";
ports = [{
port = 25;
targetPort = 2500;
}];
};
};
ingresses.inbucket.spec = {
ingressClassName = "traefik";
rules = [{
host = "inbucket.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "inbucket-web";
port.number = 80;
};
}];
}];
};
};
}