From ac4d2c3fa304d923f4ed5837e0a59781de8f1e55 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Mon, 2 Dec 2024 13:46:04 +0100 Subject: [PATCH] using an alternative stack --- apps/media-downloads/kustomization.yaml | 29 +++++++++- apps/media-downloads/namespace.yaml | 2 + apps/media-downloads/pvc.yaml | 57 +++++-------------- .../qbittorrent.configmap.yaml | 15 +++++ .../qbittorrent.deployment.yaml | 40 +++++++++++++ apps/media-downloads/qbittorrent.service.yaml | 12 ++++ apps/media-downloads/radarr.configmap.yaml | 20 +++++++ apps/media-downloads/radarr.deployment.yaml | 31 +++------- apps/media-downloads/radarr.service.yaml | 12 ++++ 9 files changed, 153 insertions(+), 65 deletions(-) create mode 100644 apps/media-downloads/qbittorrent.configmap.yaml create mode 100644 apps/media-downloads/qbittorrent.deployment.yaml create mode 100644 apps/media-downloads/qbittorrent.service.yaml create mode 100644 apps/media-downloads/radarr.configmap.yaml create mode 100644 apps/media-downloads/radarr.service.yaml diff --git a/apps/media-downloads/kustomization.yaml b/apps/media-downloads/kustomization.yaml index d0e9dc8..0f29b17 100644 --- a/apps/media-downloads/kustomization.yaml +++ b/apps/media-downloads/kustomization.yaml @@ -20,4 +20,31 @@ images: newTag: latest - name: radarr newName: lscr.io/linuxserver/radarr - newTag: 5.4.6 \ No newline at end of file + newTag: 5.4.6 + + +--- +# 2nd version +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: media-downloads + + +resources: + - namespace.yaml + - pvc.yaml + - qbittorrent.deployment.yaml + - qbittorrent.service.yaml + - qbittorrent.configmap.yaml + - radarr.deployment.yaml + - radarr.service.yaml + - radarr.configmap.yaml + - openvpn.secret.yaml + +images: + - name: qbittorrent + newName: binhex/arch-qbittorrentvpn + newTag: 5.0.1-1-02 + - name: radarr + newName: hotio/radarr + newTag: release-5.14.0.9383 diff --git a/apps/media-downloads/namespace.yaml b/apps/media-downloads/namespace.yaml index 0a074bd..1178cee 100644 --- a/apps/media-downloads/namespace.yaml +++ b/apps/media-downloads/namespace.yaml @@ -2,3 +2,5 @@ apiVersion: v1 kind: Namespace metadata: name: placeholder + labels: + pod-security.kubernetes.io/enforce: privileged diff --git a/apps/media-downloads/pvc.yaml b/apps/media-downloads/pvc.yaml index 9a425e7..99d84c5 100644 --- a/apps/media-downloads/pvc.yaml +++ b/apps/media-downloads/pvc.yaml @@ -1,42 +1,4 @@ apiVersion: v1 -kind: PersistentVolume -metadata: - name: media-downloads -spec: - capacity: - storage: "1Ti" - accessModes: - - ReadWriteMany - nfs: - path: /export/jellyfin-media/downloads - server: 192.168.1.157 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: media-downloads -spec: - storageClassName: "" - accessModes: - - ReadWriteMany - resources: - requests: - storage: "1Ti" - volumeName: media-downloads ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: jackett-config -spec: - storageClassName: "nfs-client" - accessModes: - - ReadWriteOnce - resources: - requests: - storage: "100Mi" ---- -apiVersion: v1 kind: PersistentVolumeClaim metadata: name: radarr-config @@ -46,17 +8,28 @@ spec: - ReadWriteOnce resources: requests: - storage: "100Mi" + storage: "1Gi" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: transmission-config + name: qbittorrent-config spec: storageClassName: "nfs-client" accessModes: - ReadWriteOnce resources: requests: - storage: "100Mi" ---- \ No newline at end of file + storage: "1Gi" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data +spec: + storageClassName: "nfs-client" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "10Gi" diff --git a/apps/media-downloads/qbittorrent.configmap.yaml b/apps/media-downloads/qbittorrent.configmap.yaml new file mode 100644 index 0000000..2f11ec0 --- /dev/null +++ b/apps/media-downloads/qbittorrent.configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: qbittorrent + labels: + app: qbittorrent +data: + VPN_ENABLED: yes + VPN_USER: vpnbook + VPN_PASS: e83zu76 + VPN_PROV: custom + VPN_CLIENT: openvpn + LAN_NETWORK: 10.244.0.0/24,10.9.0.0/24 + WEBUI_PORT: "8080" + ENABLE_STARTUP_SCRIPTS: no diff --git a/apps/media-downloads/qbittorrent.deployment.yaml b/apps/media-downloads/qbittorrent.deployment.yaml new file mode 100644 index 0000000..134ff0f --- /dev/null +++ b/apps/media-downloads/qbittorrent.deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: qbittorrent +spec: + selector: + matchLabels: + app: qbittorrent + replicas: 1 + template: + metadata: + labels: + app: qbittorrent + spec: + containers: + - name: qbittorrent + image: qbittorrent + ports: + - containerPort: 8080 + envFrom: + - configMapRef: + name: qbittorrent + volumeMounts: + - name: data + mountPath: /data + - name: config + mountPath: /config + + securityContext: + capabilities: + add: + - NET_ADMIN + + volumes: + - name: data + persistentVolumeClaim: + claimName: data + - name: config + persistentVolumeClaim: + claimName: qbittorrent-config diff --git a/apps/media-downloads/qbittorrent.service.yaml b/apps/media-downloads/qbittorrent.service.yaml new file mode 100644 index 0000000..68450f8 --- /dev/null +++ b/apps/media-downloads/qbittorrent.service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: qbittorrent +spec: + selector: + app: qbittorrent + type: ClusterIP + ports: + - name: qbittorrent + port: 8080 + targetPort: 8080 diff --git a/apps/media-downloads/radarr.configmap.yaml b/apps/media-downloads/radarr.configmap.yaml new file mode 100644 index 0000000..40fcdf3 --- /dev/null +++ b/apps/media-downloads/radarr.configmap.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: radarr + labels: + app: radarr +data: + # VPN_ENABLED: "true" + # VPN_CONF: "wg0" + # VPN_PROVIDER: "generic" + # VPN_LAN_NETWORK: "192.168.1.0/24" + # VPN_LAN_LEAK_ENABLED: "false" + # VPN_EXPOSE_PORTS_ON_LAN: "" + # VPN_AUTO_PORT_FORWARD: "false" + # VPN_AUTO_PORT_FORWARD_TO_PORTS: "" + # VPN_KEEP_LOCAL_DNS: "false" + # VPN_FIREWALL_TYPE: "auto" + # VPN_HEALTHCHECK_ENABLED: "false" + # PRIVOXY_ENABLED: "false" + # UNBOUND_ENABLED: "false" diff --git a/apps/media-downloads/radarr.deployment.yaml b/apps/media-downloads/radarr.deployment.yaml index 5e9376d..a0f51eb 100644 --- a/apps/media-downloads/radarr.deployment.yaml +++ b/apps/media-downloads/radarr.deployment.yaml @@ -6,6 +6,7 @@ spec: selector: matchLabels: app: radarr + replicas: 1 template: metadata: labels: @@ -14,34 +15,20 @@ spec: containers: - name: radarr image: radarr - resources: - limits: - memory: "128Mi" - cpu: "500m" ports: - containerPort: 7878 + envFrom: + - configMapRef: + name: radarr volumeMounts: - - name: media - mountPath: /media + - name: data + mountPath: /data - name: config mountPath: /config volumes: - - name: media + - name: data persistentVolumeClaim: - claimName: media-downloads + claimName: data - name: config persistentVolumeClaim: - claimName: transmission-config ---- -apiVersion: v1 -kind: Service -metadata: - name: radarr -spec: - selector: - app: radarr - ports: - - protocol: TCP - port: 7878 - targetPort: 7878 - type: ClusterIP + claimName: radarr-config diff --git a/apps/media-downloads/radarr.service.yaml b/apps/media-downloads/radarr.service.yaml new file mode 100644 index 0000000..2cca305 --- /dev/null +++ b/apps/media-downloads/radarr.service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: radarr +spec: + selector: + app: radarr + type: ClusterIP + ports: + - name: radarr + port: 7878 + targetPort: 7878 \ No newline at end of file