diff --git a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/externalsecret.yaml b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/externalsecret.yaml new file mode 100644 index 000000000..6efe7d257 --- /dev/null +++ b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/externalsecret.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: qbtools +spec: + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: qbtools-secret + template: + engineVersion: v2 + data: + SABNZBD_API_KEY: "{{ .SABNZBD_API_KEY }}" + dataFrom: + - extract: + key: sabnzbd diff --git a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/helmrelease.yaml b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/helmrelease.yaml index 3a429ae15..0f976d76c 100644 --- a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/helmrelease.yaml +++ b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/helmrelease.yaml @@ -25,12 +25,12 @@ spec: controllers: tagging: type: cronjob - cronjob: &cronjob + cronjob: schedule: "@hourly" timeZone: &timeZone ${TIMEZONE} concurrencyPolicy: Forbid successfulJobsHistory: 1 - failedJobsHistory: 1 + failedJobsHistory: 3 initContainers: tagging: &container image: @@ -43,10 +43,15 @@ spec: - --last-activity - --sites - --unregistered - - --server=qbittorrent.downloads.svc.cluster.local - - --port=80 env: + QBITTORRENT_HOST: qb.downloads.svc.cluster.local + QBITTORRENT_PORT: 80 + SABNZBD_HOST: sab.media.svc.cluster.local + SABNZBD_PORT: 80 TZ: *timeZone + envFrom: + - secretRef: + name: qbtools-secret resources: requests: cpu: 25m @@ -59,76 +64,49 @@ spec: drop: - ALL containers: - unregistered: + prune-unregistered: <<: *container args: - prune - --exclude-tag=expired + - --exclude-tag=added:1d - --include-tag=unregistered - - --server=qbittorrent.downloads.svc.cluster.local - - --port=80 - expired: + - --with-data + prune-expired: <<: *container args: - prune - --exclude-category=manual - - --exclude-tag=activity:24h + - --exclude-tag=activity:1d - --include-tag=expired - - --server=qbittorrent.downloads.svc.cluster.local - - --port=80 + - --with-data pod: - restartPolicy: OnFailure - securityContext: &podSecurityContext - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - orphaned: - type: cronjob - cronjob: - <<: *cronjob - schedule: "@daily" + restartPolicy: never + reannounce: containers: app: <<: *container args: - - orphaned - - --exclude-pattern="*_unpackerred" - - --exclude-pattern="*/manual/*" - - --server=qbittorrent.downloads.svc.cluster.local - - --port=80 - pod: - restartPolicy: OnFailure - securityContext: - <<: *podSecurityContext - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 65536 - reannounce: + - reannounce + limiter: containers: app: <<: *container args: - - reannounce - - --process-seeding - - --server=qbittorrent.downloads.svc.cluster.local - - --port=80 - pod: - securityContext: *podSecurityContext + - limiter + - --max-line-speed-mbps=500 + - --max-percent=0.8 + - --limit-percent=0.4 + defaultPodOptions: + securityContext: + runAsNonRoot: true + runAsUser: 568 + runAsGroup: 568 persistence: config: type: configMap name: qbtools-configmap - advancedMounts: - tagging: - tagging: - - path: /config/config.yaml - subPath: config.yaml - readOnly: true - media: - type: nfs - server: citadel.internal - path: /mnt/storage0/media globalMounts: - - path: /media/Downloads/qbittorrent - subPath: Downloads/qbittorrent + - path: /config/config.yaml + subPath: config.yaml + readOnly: true diff --git a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/kustomization.yaml b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/kustomization.yaml index a41681783..903776d2b 100644 --- a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/kustomization.yaml +++ b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/kustomization.yaml @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - ./externalsecret.yaml - ./helmrelease.yaml configMapGenerator: - name: qbtools-configmap diff --git a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/resources/config.yaml b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/resources/config.yaml index 99a81e914..e789ae91a 100644 --- a/kubernetes/apps/downloads/qbittorrent/tools/qbtools/resources/config.yaml +++ b/kubernetes/apps/downloads/qbittorrent/tools/qbtools/resources/config.yaml @@ -1,91 +1,140 @@ --- trackers: - - name: aither - urls: ["aither.cc"] - required_seed_ratio: 0 - required_seed_days: 7.1 - - - name: alpharatio - urls: ["alpharatio.cc"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: anthelion - urls: ["anthelion.me"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: blutopia - urls: ["blutopia.cc", "blutopia.xyz"] - required_seed_ratio: 0 - required_seed_days: 7.1 - - - name: filelist - urls: ["filelist.io", "flro.org"] - required_seed_ratio: 1.01 - required_seed_days: 2.1 - - - name: hd-space - urls: ["hd-space.pw"] - required_seed_ratio: 0 - required_seed_days: 2.1 - - - name: hd-torrents - urls: ["hdts-announce.ru"] - required_seed_ratio: 1.01 - required_seed_days: 3.1 - - - name: iptorrents - urls: ["bgp.technology", "empirehost.me", "stackoverflow.tech"] - required_seed_ratio: 1.01 - required_seed_days: 14.1 - - - name: milkie - urls: ["cow.milkie.cc"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: morethantv - urls: ["morethantv.me"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: nebulance - urls: ["nebulance.io"] - required_seed_ratio: 0 - required_seed_days: 5.1 - - - name: passthepopcorn - urls: ["passthepopcorn.me"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: privatehd - urls: ["privatehd.to"] - required_seed_ratio: 0.91 - required_seed_days: 14.1 - - - name: scenetime - urls: ["scenetime.com"] - required_seed_ratio: 1.01 - required_seed_days: 3.1 - - - name: torrentday - urls: ["jumbohostpro.eu", "td-peers.com"] - required_seed_ratio: 1.01 - required_seed_days: 3.1 - - - name: torrentleech - urls: ["tleechreload.org", "torrentleech.org"] - required_seed_ratio: 1.01 - required_seed_days: 6.1 - - - name: torrentseeds - urls: ["torrentseeds.org"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 - - - name: uhdbits - urls: ["uhdbits.org"] - required_seed_ratio: 1.01 - required_seed_days: 7.1 + - { + name: ath, + required_seed_ratio: 0, + required_seed_days: 0, + urls: ["aither.cc"], + } + - { + name: ar, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["alpharatio.cc"], + } + - { + name: ant, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["anthelion.me"], + } + - { + name: ats, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["animetosho.org"], + } + - { + name: bhd, + required_seed_ratio: 0, + required_seed_days: 0, + urls: ["beyond-hd.me"], + } + - { + name: blu, + required_seed_ratio: 0, + required_seed_days: 7.1, + urls: ["blutopia.cc", "blutopia.xyz"], + } + - { + name: fnp, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["fearnopeer.com"], + } + - { + name: fl, + required_seed_ratio: 1.01, + required_seed_days: 2.1, + urls: ["filelist.io", "flro.org"], + } + - { + name: hds, + required_seed_ratio: 0, + required_seed_days: 2.1, + urls: ["hd-space.pw"], + } + - { + name: hdt, + required_seed_ratio: 1.01, + required_seed_days: 3.1, + urls: ["hdts-announce.ru"], + } + - { + name: ipt, + required_seed_ratio: 1.01, + required_seed_days: 14.1, + urls: ["bgp.technology", "empirehost.me", "stackoverflow.tech"], + } + - { + name: mam, + required_seed_ratio: 1.01, + required_seed_days: 3.0, + urls: ["myanonamouse.net"], + } + - { + name: mlk, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["milkie.cc"], + } + - { + name: mtv, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["morethantv.me"], + } + - { + name: nbl, + required_seed_ratio: 0, + required_seed_days: 5.1, + urls: ["nebulance.io"], + } + - { + name: ptp, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["passthepopcorn.me"], + } + - { + name: phd, + required_seed_ratio: 0.91, + required_seed_days: 14.1, + urls: ["privatehd.to"], + } + - { + name: rfx, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["reelflix.xyz"], + } + - { + name: st, + required_seed_ratio: 1.01, + required_seed_days: 3.1, + urls: ["scenetime.com"], + } + - { + name: td, + required_seed_ratio: 1.01, + required_seed_days: 3.1, + urls: ["jumbohostpro.eu", "td-peers.com"], + } + - { + name: tl, + required_seed_ratio: 1.01, + required_seed_days: 6.1, + urls: ["tleechreload.org", "torrentleech.org"], + } + - { + name: ts, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["torrentseeds.org"], + } + - { + name: uhd, + required_seed_ratio: 1.01, + required_seed_days: 7.1, + urls: ["uhdbits.org"], + }