Test
This commit is contained in:
commit
ea54732e09
49
apps/guestbook/service.py
Normal file
49
apps/guestbook/service.py
Normal file
@ -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),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
[],
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user