migrate kitchenowl to kubernetes

This commit is contained in:
Pim Kunis 2024-03-29 14:26:05 +01:00
parent 35280d34b4
commit 31b95c9a49
5 changed files with 101 additions and 5 deletions

View file

@ -5,5 +5,4 @@
- {role: traefik, tags: traefik}
- {role: forgejo, tags: forgejo}
- {role: swarm_dashboard, tags: swarm_dashboard}
- {role: kitchenowl, tags: kitchenowl}
- {role: media, tags: media}

View file

@ -108,6 +108,12 @@ services:
- traefik.http.routers.paperless-ngx.rule=Host(`paperless.kun.is`)
- traefik.http.routers.paperless-ngx.tls=true
- traefik.http.routers.paperless-ngx.tls.certresolver=letsencrypt
- traefik.http.routers.kitchenowl.entrypoints=websecure
- traefik.http.routers.kitchenowl.service=k3s@file
- traefik.http.routers.kitchenowl.rule=Host(`boodschappen.kun.is`)
- traefik.http.routers.kitchenowl.tls=true
- traefik.http.routers.kitchenowl.tls.certresolver=letsencrypt
volumes:
- type: bind
source: /var/run/docker.sock

View file

@ -17,6 +17,7 @@
./pihole.nix
# ./hedgedoc.nix
./paperless-ngx.nix
./kitchenowl.nix
];
kubernetes.kubeconfig = "~/.kube/config";
kubenix.project = "home";

View file

@ -0,0 +1,94 @@
{
kubernetes.resources = {
configMaps.kitchenowl.data = {
BACK_URL = "localhost:5000";
};
secrets.kitchenowl.stringData.jwtSecretKey = "ref+file:///home/pim/.config/home/vals.yaml#/kitchenowl/jwtSecretKey";
deployments.kitchenowl = {
metadata.labels.app = "kitchenowl";
spec = {
selector.matchLabels.app = "kitchenowl";
template = {
metadata.labels.app = "kitchenowl";
spec = {
containers = {
kitchenowl-frontend = {
image = "tombursch/kitchenowl-web:v0.4.20";
envFrom = [{ configMapRef.name = "kitchenowl"; }];
ports = [{
containerPort = 80;
protocol = "TCP";
}];
};
kitchenowl-backend = {
image = "tombursch/kitchenowl:v92";
volumeMounts = [{
name = "data";
mountPath = "/data";
}];
};
};
volumes = [{
name = "data";
persistentVolumeClaim.claimName = "kitchenowl";
}];
};
};
};
};
persistentVolumes.kitchenowl.spec = {
capacity.storage = "1Mi";
accessModes = [ "ReadWriteMany" ];
nfs = {
server = "lewis.hyp";
path = "/mnt/data/nfs/kitchenowl/data";
};
};
persistentVolumeClaims.kitchenowl.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
volumeName = "kitchenowl";
};
services.kitchenowl.spec = {
selector.app = "kitchenowl";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 80;
}];
};
ingresses.kitchenowl.spec = {
ingressClassName = "traefik";
rules = [{
host = "boodschappen.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "kitchenowl";
port.number = 80;
};
}];
}];
};
};
}

View file

@ -6,16 +6,12 @@
PAPERLESS_DBHOST = "lewis.dmz";
PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBUSER = "paperless";
# PAPERLESS_DBPASS = "{{ paperless_db_password }}";
# PAPERLESS_CONSUMPTION_DIR = "/nextcloud/data/pim/files/paperless-ngx/consumption/";
PAPERLESS_DATA_DIR = "/data/";
PAPERLESS_MEDIA_ROOT = "/data/";
# PAPERLESS_CONSUMER_POLLING = "10";
PAPERLESS_OCR_LANGUAGES = "nld eng";
PAPERLESS_URL = "https://paperless.kun.is";
PAPERLESS_TIME_ZONE = "Europe/Amsterdam";
PAPERLESS_OCR_LANGUAGE = "nld";
# PAPERLESS_SECRET_KEY = "{{ paperless_secret_key }}";
USERMAP_UID = "33";
USERMAP_GID = "33";
};