migrate prowlarr to kubernetes

This commit is contained in:
Pim Kunis 2024-04-06 17:36:29 +02:00
parent 75b609ea90
commit 100af46f88
3 changed files with 127 additions and 24 deletions

View file

@ -49,30 +49,30 @@ volumes:
jellyfin_cache: jellyfin_cache:
services: services:
prowlarr: # prowlarr:
image: lscr.io/linuxserver/prowlarr:latest # image: lscr.io/linuxserver/prowlarr:latest
environment: # environment:
- PUID=1000 # - PUID=1000
- PGID=1000 # - PGID=1000
- TZ=Europe/Amsterdam # - TZ=Europe/Amsterdam
volumes: # volumes:
- type: volume # - type: volume
source: prowlarr_config # source: prowlarr_config
target: /config # target: /config
volume: # volume:
nocopy: true # nocopy: true
networks: # networks:
- traefik # - traefik
deploy: # deploy:
labels: # labels:
- traefik.enable=true # - traefik.enable=true
- traefik.http.routers.prowlarr.entrypoints=localsecure # - traefik.http.routers.prowlarr.entrypoints=localsecure
- traefik.http.routers.prowlarr.rule=Host(`prowlarr.kun.is`) # - traefik.http.routers.prowlarr.rule=Host(`prowlarr.kun.is`)
- traefik.http.routers.prowlarr.tls=true # - traefik.http.routers.prowlarr.tls=true
- traefik.http.routers.prowlarr.tls.certresolver=letsencrypt # - traefik.http.routers.prowlarr.tls.certresolver=letsencrypt
- traefik.http.routers.prowlarr.service=prowlarr # - traefik.http.routers.prowlarr.service=prowlarr
- traefik.http.services.prowlarr.loadbalancer.server.port=9696 # - traefik.http.services.prowlarr.loadbalancer.server.port=9696
- traefik.docker.network=traefik # - traefik.docker.network=traefik
sonarr: sonarr:
image: lscr.io/linuxserver/sonarr:latest image: lscr.io/linuxserver/sonarr:latest

View file

@ -144,6 +144,12 @@ services:
- traefik.http.routers.radarr.rule=Host(`radarr.kun.is`) - traefik.http.routers.radarr.rule=Host(`radarr.kun.is`)
- traefik.http.routers.radarr.tls=true - traefik.http.routers.radarr.tls=true
- traefik.http.routers.radarr.tls.certresolver=letsencrypt - traefik.http.routers.radarr.tls.certresolver=letsencrypt
- traefik.http.routers.prowlarr.entrypoints=localsecure
- traefik.http.routers.prowlarr.service=k3s@file
- traefik.http.routers.prowlarr.rule=Host(`prowlarr.kun.is`)
- traefik.http.routers.prowlarr.tls=true
- traefik.http.routers.prowlarr.tls.certresolver=letsencrypt
volumes: volumes:
- type: bind - type: bind
source: /var/run/docker.sock source: /var/run/docker.sock

View file

@ -18,6 +18,12 @@
PGID = "1000"; PGID = "1000";
TZ = "Europe/Amsterdam"; TZ = "Europe/Amsterdam";
}; };
prowlarr-env.data = {
PUID = "1000";
PGID = "1000";
TZ = "Europe/Amsterdam";
};
}; };
deployments = { deployments = {
@ -236,6 +242,49 @@
}; };
}; };
}; };
prowlarr = {
metadata.labels = {
app = "media";
component = "prowlarr";
};
spec = {
selector.matchLabels = {
app = "media";
component = "prowlarr";
};
template = {
metadata.labels = {
app = "media";
component = "prowlarr";
};
spec = {
containers.prowlarr = {
image = "lscr.io/linuxserver/prowlarr:latest";
envFrom = [{ configMapRef.name = "prowlarr-env"; }];
ports = [{
containerPort = 9696;
protocol = "TCP";
}];
volumeMounts = [{
name = "config";
mountPath = "/config";
}];
};
volumes = [{
name = "config";
persistentVolumeClaim.claimName = "prowlarr-config";
}];
};
};
};
};
}; };
persistentVolumes = { persistentVolumes = {
@ -288,6 +337,16 @@
path = "/mnt/data/nfs/radarr/config"; path = "/mnt/data/nfs/radarr/config";
}; };
}; };
prowlarr-config.spec = {
capacity.storage = "1Mi";
accessModes = [ "ReadWriteMany" ];
nfs = {
server = "lewis.hyp";
path = "/mnt/data/nfs/prowlarr/config";
};
};
}; };
persistentVolumeClaims = { persistentVolumeClaims = {
@ -325,6 +384,13 @@
resources.requests.storage = "1Mi"; resources.requests.storage = "1Mi";
volumeName = "radarr-config"; volumeName = "radarr-config";
}; };
prowlarr-config.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
volumeName = "prowlarr-config";
};
}; };
services = { services = {
@ -395,6 +461,19 @@
targetPort = 7878; targetPort = 7878;
}]; }];
}; };
prowlarr.spec = {
selector = {
app = "media";
component = "prowlarr";
};
ports = [{
protocol = "TCP";
port = 80;
targetPort = 9696;
}];
};
}; };
ingresses = { ingresses = {
@ -469,6 +548,24 @@
}]; }];
}]; }];
}; };
prowlarr.spec = {
ingressClassName = "traefik";
rules = [{
host = "prowlarr.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "prowlarr";
port.number = 80;
};
}];
}];
};
}; };
}; };
} }