From ea54732e0996eb8d7f4621184d8ea0271d5812b1 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sat, 18 Jan 2025 01:30:10 +0100 Subject: [PATCH] Test --- apps/guestbook/service.py | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 apps/guestbook/service.py diff --git a/apps/guestbook/service.py b/apps/guestbook/service.py new file mode 100644 index 0000000..6a89e7e --- /dev/null +++ b/apps/guestbook/service.py @@ -0,0 +1,49 @@ +from mkkube.kubernetes.struct import ( + BaseService, + Port, + Env, + SecretEnv, + PVCMount, + PodSecurity, + TCPProbe, + BaseContainer, +) +from mkkube.types import ServiceGenerationResult, KubeContext + +def build(_: KubeContext) -> ServiceGenerationResult: + return ( + BaseService( + traefik_accessible=True, + database_access=False, + valkey_access=False, + name="guestbook", + namespace="guestbook", + containers=[ + BaseContainer( + name="guestbook", + image="git.polynom.me/papatutuwawa/anki:latest", + ports=[ + Port(8080, "TCP", "http"), + ], + command=[ + "anki", + "--syncserver", + ], + env=[ + Env("SYNC_BASE", "/var/lib/anki"), + SecretEnv("SYNC_USER1", "anki-secrets", "user1"), + ], + mounts=[ + PVCMount("anki-data", "/var/lib/anki", "anki-pvc", 2), + ], + pod_security=PodSecurity( + user=101, + cap_drop=["ALL"], + readonly_fs=False, + ), + readiness_probe=TCPProbe(8080), + ), + ], + ), + [], + )