kubernetes-deployments/modules/blog.nix

47 lines
821 B
Nix
Raw Normal View History

2024-10-28 15:05:06 +00:00
{
2024-12-31 10:29:29 +00:00
utils,
2024-10-28 15:05:06 +00:00
lib,
config,
...
}: {
2024-09-07 10:35:02 +00:00
options.blog.enable = lib.mkEnableOption "blog";
config = lib.mkIf config.blog.enable {
kubernetes.resources = {
deployments.blog.spec = {
replicas = 3;
selector.matchLabels.app = "blog";
template = {
metadata.labels.app = "blog";
spec = {
containers.blog = {
2024-12-31 10:29:29 +00:00
image = utils.mkNixNGImage "blog";
2024-09-07 10:35:02 +00:00
ports.web.containerPort = 80;
};
};
};
};
services.blog.spec = {
selector.app = "blog";
ports.web = {
port = 80;
targetPort = "web";
};
};
};
lab.ingresses.blog = {
host = "pim.kun.is";
service = {
name = "blog";
portName = "web";
};
};
};
}