diff --git a/cdk8s/dist/lamport.k8s.yaml b/cdk8s/dist/lamport.k8s.yaml index 4e57142d..1df110de 100644 --- a/cdk8s/dist/lamport.k8s.yaml +++ b/cdk8s/dist/lamport.k8s.yaml @@ -1478,7 +1478,7 @@ spec: - mountPath: /config name: pvc-qbittorrent-pvc - mountPath: /downloads - name: qbittorrent-bind-mount + name: pvc-qbittorrent-download-pvc dnsPolicy: ClusterFirst hostNetwork: false restartPolicy: Always @@ -1496,10 +1496,10 @@ spec: persistentVolumeClaim: claimName: qbittorrent-pvc readOnly: false - - hostPath: - path: /mnt/storage/downloads/torrents - type: "" - name: qbittorrent-bind-mount + - name: pvc-qbittorrent-download-pvc + persistentVolumeClaim: + claimName: qbittorrent-download-pvc + readOnly: false --- apiVersion: v1 kind: PersistentVolumeClaim @@ -1528,6 +1528,19 @@ spec: volumeMode: Filesystem --- apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: qbittorrent-download-pvc + namespace: lamport +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi + volumeMode: Filesystem +--- +apiVersion: v1 kind: Service metadata: annotations: diff --git a/cdk8s/src/services/torrents/qbittorrent.ts b/cdk8s/src/services/torrents/qbittorrent.ts index c472b382..d1a2dd96 100644 --- a/cdk8s/src/services/torrents/qbittorrent.ts +++ b/cdk8s/src/services/torrents/qbittorrent.ts @@ -34,6 +34,12 @@ export function createQBitTorrentDeployment(chart: Chart) { {}, ); + const downloadPathVolume = new LocalPathVolume( + chart, + "qbittorrent-download-pvc", + {}, + ); + deployment.addContainer( withCommonProps({ name: "gluetun", @@ -96,17 +102,13 @@ export function createQBitTorrentDeployment(chart: Chart) { localPathVolume.claim, ), }, - // TODO: replace this with a shared volume on the RAID array { - volume: Volume.fromHostPath( + path: "/downloads", + volume: Volume.fromPersistentVolumeClaim( chart, - "qbittorrent-bind-mount", - "qbittorrent-bind-mount", - { - path: "/mnt/storage/downloads/torrents", - }, + "qbittorrent-downloads-volume", + downloadPathVolume.claim, ), - path: "/downloads", }, ], }),