Skip to content

Commit

Permalink
use volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerred committed Feb 11, 2024
1 parent 2cf7a2f commit c9d6608
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
23 changes: 18 additions & 5 deletions cdk8s/dist/lamport.k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 10 additions & 8 deletions cdk8s/src/services/torrents/qbittorrent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export function createQBitTorrentDeployment(chart: Chart) {
{},
);

const downloadPathVolume = new LocalPathVolume(
chart,
"qbittorrent-download-pvc",
{},
);

deployment.addContainer(
withCommonProps({
name: "gluetun",
Expand Down Expand Up @@ -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",
},
],
}),
Expand Down

0 comments on commit c9d6608

Please sign in to comment.