add qbtools

This commit is contained in:
Joseph Hanson 2024-08-15 12:23:27 -05:00
parent afe5176b0e
commit 9f6fed7a26
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
4 changed files with 200 additions and 0 deletions

View file

@ -27,3 +27,24 @@ spec:
VOLSYNC_CAPACITY: 2Gi
VOLSYNC_STORAGECLASS: openebs-zfs
VOLSYNC_SNAPSHOTCLASS: openebs-zfs
---
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app qbittorrent-tools
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/qbittorrent/qbittorrent/tools
prune: true
sourceRef:
kind: GitRepository
name: homelab
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m

View file

@ -0,0 +1,146 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: qbtools
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.3.2
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
dependsOn:
- name: qbittorrent
namespace: qbittorrent
values:
controllers:
tagging:
type: cronjob
cronjob: &cronJobSpec
schedule: "@hourly"
timeZone: &timeZone America/Chicago
concurrencyPolicy: Forbid
successfulJobsHistory: 1
failedJobsHistory: 1
initContainers:
tagging: &container
image:
repository: ghcr.io/buroa/qbtools
tag: v0.15.4@sha256:51c454cdf95e216a8f40ec5744ecbd8f29a924b4aada805fee64beb0b89cbe59
env:
TZ: *timeZone
POD_NAMESPACE:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args: [
"tagging",
"--added-on",
"--expired",
"--last-activity",
"--sites",
"--unregistered",
"--server", "qbittorrent.$(POD_NAMESPACE).svc.cluster.local",
"--port", "80",
"--config", "/config/config.yaml"
]
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities: { drop: ["ALL"] }
resources:
requests:
cpu: 25m
limits:
memory: 256M
containers:
unregistered:
<<: *container
args: [
"prune",
"--exclude-category", "manual",
"--exclude-category", "music",
"--exclude-tag", "added:24h",
"--include-tag", "unregistered",
"--dry-run",
"--server", "qbittorrent.$(POD_NAMESPACE).svc.cluster.local",
"--port", "80"
]
expired:
<<: *container
args: [
"prune",
"--exclude-category", "manual",
"--exclude-category", "music",
"--include-tag", "expired", # defined in config.yaml
"--include-tag", "added:7d",
"--dry-run",
"--server", "qbittorrent.$(POD_NAMESPACE).svc.cluster.local",
"--port", "80"
]
pod:
restartPolicy: OnFailure
orphaned:
type: cronjob
cronjob:
<<: *cronJobSpec
schedule: "@daily"
containers:
app:
<<: *container
args: [
"orphaned",
"--exclude-pattern", "*_unpackerred*",
"--exclude-pattern", "*/manual/*",
"--dry-run",
"--server", "qbittorrent.$(POD_NAMESPACE).svc.cluster.local",
"--port", "80"
]
pod:
restartPolicy: OnFailure
reannounce:
containers:
app:
<<: *container
args: [
"reannounce",
"--process-seeding",
"--server", "qbittorrent.$(POD_NAMESPACE).svc.cluster.local",
"--port", "80"
]
defaultPodOptions:
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
seccompProfile: { type: RuntimeDefault }
persistence:
secret-file:
type: secret
name: qbtools-secret
globalMounts:
- path: /config/config.yaml
subPath: config.yaml
readOnly: true
media:
type: nfs
server: 10.1.1.11
path: /volume1/Media
advancedMounts:
orphaned:
app:
- path: /data/nas-media
subPath: qb/downloads

View file

@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./qbtools.secret.sops.y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xkztLkPpLGHpd4zI8Y3riHtv2di57/ktUP9acc4kIk2LyYiN6jwKEOc2HTmSE3l2qdBXoy6Rcl/V/Uz1hOE3vOFUNJQL2sRyBf/0R7IKzXRieghR9h17pKYAsvbN9vO02dLevSYsqktowjwA1QXxxR2Vzp15tMV45T/nP5XLe3+f4zfJjRSuNM13ddowXp6smUOZ0Myw=,iv:FszW51oSi/iKN1cquyhF+HwStHgpgmioyopdJriuiOw=,tag:GYaRuyCgXuGVWyxShyH39Q==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1eqlaq205y5jre9hu5hvulywa7w3d4qyxwmafneamxcn7nejesedsf4q9g6
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5UzFWbHB0bVlGQXV4dEVt
ZUxrcnZ1MlFOY2o2eTl0cDV3T3BKdmNMUXg0CmcyejMzV1loSUNIMEw0K09yc3Ax
NGZOTE1tamV2a05kZm9lNkpoeG9OWm8KLS0tIEVVM01nSjhQYzBOZ0MrY2JpODRz
MGNWSGJmaXdkbUJDOHpCRk9YWUZVSm8KGGHivrtQfHayo6BGbH+Tch3fzVlFNU3s
lLec6VZauGjIXifXBLC5e65SrSO/nZS4xsurrZovOLn3DpeDQu/4+Q==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-15T17:21:52Z"
mac: ENC[AES256_GCM,data:V+K/2CEFommRZ7kkJlUSjOIMQL8c3OtnJnPT7heHpkGUm/XJ8JFAhqHc5G6D6bjN6vsXcr7X7b9Tm6OBNPHBCJIekBahySUThHc6IxhQrNVTMu2lNOS9B7+VwZN2oezmEwbpY+5dT+3angWiBy2k5XW/7hmVlz1mQX8tJBTUHOM=,iv:LorlvJFs067H6FI/UPvIgRi9xTReOTfv13IdInFhcAU=,tag:72TTcNC6Fh3SiWlJa2xgzg==,type:str]
pgp: []
encrypted_regex: ^(data|stringData)$
version: 3.8.1