qbittorrent

This commit is contained in:
Michael Thomson
2023-12-19 15:17:44 -05:00
parent 1783a0a6b7
commit c18b630e72
9 changed files with 20 additions and 23 deletions

View File

@@ -0,0 +1,91 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: qbittorrent
namespace: media
spec:
selector:
matchLabels:
app: qbittorrent
template:
metadata:
labels:
app: qbittorrent
spec:
containers:
- name: qbittorrent
image: lscr.io/linuxserver/qbittorrent:latest
envFrom:
- configMapRef:
name: qbittorrent-config
optional: false
ports:
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 6881
name: udp
protocol: UDP
- containerPort: 6881
name: tcp
protocol: TCP
volumeMounts:
- name: qbittorrent-config
mountPath: /config
- mountPath: /data/downloads
name: data
subPath: downloads
- name: wireguard
image: lscr.io/linuxserver/wireguard:latest
envFrom:
- configMapRef:
name: wireguard-config
optional: false
securityContext:
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
privileged: true
ports:
- containerPort: 51820
name: tun
protocol: UDP
lifecycle:
postStart:
exec:
command: ['cp', '/wireguard-secret/deluge.conf', '/config/wg_confs/wg0.conf']
volumeMounts:
- name: wireguard-config
mountPath: /config
- name: wireguard-secret
readOnly: true
mountPath: /wireguard-secret
initContainers:
- name: init-media-filesystem
image: busybox
command:
- /bin/sh
- -c
- |
mkdir -p -v /data/downloads/movies /data/downloads/tv /data/downloads/books /data/downloads/audiobooks /data/media/movies /data/media/tv /data/media/books /data/media/audiobooks
chown -R 1000:1000 /data
chmod -R a=,a+rX,u+w,g+w /data
volumeMounts:
- mountPath: /data
name: data
volumes:
- name: qbittorrent-config
persistentVolumeClaim:
claimName: qbittorrent-config
- name: wireguard-config
persistentVolumeClaim:
claimName: wireguard-config
- name: data
persistentVolumeClaim:
claimName: media-data
- name: wireguard-secret
secret:
secretName: wireguard-secret

View File

@@ -0,0 +1,12 @@
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: qbittorrent.michaelthomson.dev
namespace: media
spec:
endpoints:
- dnsName: qbittorrent.michaelthomson.dev
recordTTL: 180
recordType: CNAME
targets:
- server.michaelthomson.dev

View File

@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: qbittorrent
namespace: media
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: traefik-authentik@kubernetescrd
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
rules:
- host: qbittorrent.michaelthomson.dev
http:
paths:
- pathType: ImplementationSpecific
path: /
backend:
service:
name: qbittorrent
port:
name: http
tls:
- hosts:
- qbittorrent.michaelthomson.dev
secretName: letsencrypt-wildcard-cert-michaelthomson.dev

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: qbittorrent-config
namespace: media
spec:
resources:
requests:
storage: 1Gi
storageClassName: longhorn
accessModes:
- ReadWriteOnce

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wireguard-config
namespace: media
spec:
resources:
requests:
storage: 1Gi
storageClassName: longhorn
accessModes:
- ReadWriteOnce

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: qbittorrent-config
namespace: media
data:
PUID: "1000"
PGID: "1000"

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: qbittorrent
namespace: media
spec:
selector:
app: qbittorrent
ports:
- port: 80
targetPort: http
name: http

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: wireguard-config
namespace: media
data:
PUID: "1000"
PGID: "1000"

View File

@@ -0,0 +1,14 @@
kind: SealedSecret
apiVersion: bitnami.com/v1alpha1
metadata:
name: wireguard-secret
namespace: media
creationTimestamp:
spec:
template:
metadata:
name: wireguard-secret
namespace: media
creationTimestamp:
encryptedData:
deluge.conf: AgAGasaRn64/JK2L1t1mQWRnxtjAUTgRR0vv/MQpWRnPoPHHD4lh2Uc2w7PIASIL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