From d833b055ee612b91a0a2ad02eb78004f2d9d840a Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Mon, 22 Apr 2024 23:46:59 +0200 Subject: [PATCH] add k8s deployment for blog --- kubenix-modules/all.nix | 1 + kubenix-modules/blog.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 kubenix-modules/blog.nix diff --git a/kubenix-modules/all.nix b/kubenix-modules/all.nix index 1d79b28..d836c1d 100644 --- a/kubenix-modules/all.nix +++ b/kubenix-modules/all.nix @@ -24,5 +24,6 @@ ./custom/ingress.nix ./custom/nfs-volume.nix ./traefik.nix + ./blog.nix ]; } diff --git a/kubenix-modules/blog.nix b/kubenix-modules/blog.nix new file mode 100644 index 0000000..1a83a4b --- /dev/null +++ b/kubenix-modules/blog.nix @@ -0,0 +1,40 @@ +{ + kubernetes.resources = { + deployments.blog = { + metadata.labels.app = "blog"; + + spec = { + selector.matchLabels.app = "blog"; + + template = { + metadata.labels.app = "blog"; + + spec = { + containers.blog = { + image = "git.kun.is/pim/static:test3"; + 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"; + }; + }; +}