nixos-servers/nix/flake/kubenix/kitchenowl.nix

159 lines
3.6 KiB
Nix
Raw Normal View History

2024-03-29 13:26:05 +00:00
{
kubernetes.resources = {
configMaps.kitchenowl.data = {
BACK_URL = "kitchenowl-backend.default.svc.cluster.local:5000";
2024-03-29 13:26:05 +00:00
};
secrets.kitchenowl.stringData.jwtSecretKey = "ref+file:///home/pim/.config/home/vals.yaml#/kitchenowl/jwtSecretKey";
deployments = {
# TODO: this is quite a lot of boilerplate to create these deployments
# Create custom nixos module for this?
kitchenowl-frontend = {
metadata.labels = {
app = "kitchenowl";
component = "frontend";
};
spec = {
selector.matchLabels = {
app = "kitchenowl";
component = "frontend";
};
template = {
metadata.labels = {
app = "kitchenowl";
component = "frontend";
};
2024-03-29 13:26:05 +00:00
spec.containers.kitchenowl-frontend = {
image = "tombursch/kitchenowl-web:v0.4.20";
envFrom = [{ configMapRef.name = "kitchenowl"; }];
2024-03-29 13:26:05 +00:00
ports = [{
containerPort = 80;
protocol = "TCP";
}];
};
};
};
};
kitchenowl-backend = {
metadata.labels = {
app = "kitchenowl";
component = "backend";
};
spec = {
selector.matchLabels = {
app = "kitchenowl";
component = "backend";
};
template = {
metadata.labels = {
app = "kitchenowl";
component = "backend";
};
2024-03-29 13:26:05 +00:00
spec = {
containers.kitchenowl-backend = {
image = "tombursch/kitchenowl:v92";
2024-03-29 13:26:05 +00:00
ports = [{
containerPort = 5000;
2024-03-29 13:26:05 +00:00
protocol = "TCP";
}];
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "kitchenowl";
}];
};
2024-03-29 13:26:05 +00:00
};
};
};
};
persistentVolumes.kitchenowl.spec = {
capacity.storage = "1Mi";
accessModes = [ "ReadWriteMany" ];
nfs = {
2024-04-12 21:31:10 +00:00
server = "lewis.dmz";
2024-03-29 13:26:05 +00:00
path = "/mnt/data/nfs/kitchenowl/data";
};
};
persistentVolumeClaims.kitchenowl.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
volumeName = "kitchenowl";
};
services = {
kitchenowl-web.spec = {
selector = {
app = "kitchenowl";
component = "frontend";
};
2024-03-29 13:26:05 +00:00
ports = [{
protocol = "TCP";
port = 80;
targetPort = 80;
}];
};
kitchenowl-backend.spec = {
selector = {
app = "kitchenowl";
component = "backend";
};
ports = [{
protocol = "TCP";
port = 5000;
targetPort = 5000;
}];
};
2024-03-29 13:26:05 +00:00
};
ingresses.kitchenowl = {
metadata.annotations."cert-manager.io/cluster-issuer" = "letsencrypt";
2024-03-29 13:26:05 +00:00
spec = {
ingressClassName = "traefik";
2024-03-29 13:26:05 +00:00
rules = [{
host = "boodschappen.kun.is";
2024-03-29 13:26:05 +00:00
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "kitchenowl-web";
port.number = 80;
};
}];
2024-03-29 13:26:05 +00:00
}];
tls = [{
secretName = "kitchenowl-tls";
hosts = [ "boodschappen.kun.is" ];
}];
};
2024-03-29 13:26:05 +00:00
};
};
}