qbittorrentvpn.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: qbittorrentvpn
  6. namespace: plex
  7. spec:
  8. strategy:
  9. type: Recreate
  10. selector:
  11. matchLabels:
  12. app: qbittorrentvpn
  13. replicas: 1
  14. template:
  15. metadata:
  16. labels:
  17. app: qbittorrentvpn
  18. annotations:
  19. backup.velero.io/backup-volumes-excludes: seedbox,media,media2,data-ec,scratch
  20. spec:
  21. affinity:
  22. nodeAffinity:
  23. requiredDuringSchedulingIgnoredDuringExecution:
  24. nodeSelectorTerms:
  25. - matchExpressions:
  26. - key: seedbox
  27. operator: In
  28. values:
  29. - "true"
  30. tolerations:
  31. - key: seedbox
  32. operator: Equal
  33. value: "true"
  34. effect: NoSchedule
  35. containers:
  36. - name: qbittorrentvpn
  37. image: binhex/arch-qbittorrentvpn:5.1.0-1-01
  38. ports:
  39. - containerPort: 8080
  40. name: http-web-svc
  41. securityContext:
  42. privileged: true
  43. envFrom:
  44. - secretRef:
  45. name: qbittorrentvpn-secret
  46. volumeMounts:
  47. - mountPath: "/data"
  48. name: seedbox
  49. - mountPath: "/media"
  50. name: media
  51. - mountPath: "/media2"
  52. name: media2
  53. - mountPath: "/dataec"
  54. name: data-ec
  55. - mountPath: "/config"
  56. name: config
  57. - mountPath: "/scratch"
  58. name: scratch
  59. volumes:
  60. - name: seedbox
  61. persistentVolumeClaim:
  62. claimName: seedbox-pvc
  63. - name: media
  64. persistentVolumeClaim:
  65. claimName: plex-pvc
  66. - name: media2
  67. persistentVolumeClaim:
  68. claimName: media2-pvc
  69. - name: data-ec
  70. persistentVolumeClaim:
  71. claimName: data-ec-pvc
  72. - name: config
  73. persistentVolumeClaim:
  74. claimName: qbittorrentvpn-pvc
  75. - name: scratch
  76. hostPath:
  77. path: /mnt/data/torrents
  78. type: Directory
  79. ---
  80. apiVersion: apps/v1
  81. kind: Deployment
  82. metadata:
  83. name: qbittorrentvpn-exporter
  84. namespace: plex
  85. spec:
  86. strategy:
  87. type: Recreate
  88. selector:
  89. matchLabels:
  90. app: qbittorrentvpn-exporter
  91. replicas: 1
  92. template:
  93. metadata:
  94. labels:
  95. app: qbittorrentvpn-exporter
  96. spec:
  97. containers:
  98. - name: qbittorrentvpn-exporter
  99. image: ghcr.io/esanchezm/prometheus-qbittorrent-exporter:v1.6.0
  100. ports:
  101. - containerPort: 8000
  102. name: metrics
  103. envFrom:
  104. - secretRef:
  105. name: qbittorrentvpn-exporter-secret
  106. livenessProbe:
  107. exec:
  108. command:
  109. - "/bin/sh"
  110. - "-c"
  111. - 'wget -O - 0.0.0.0:8000 | grep -E "qbittorrent_up\{.* 1.0"'
  112. initialDelaySeconds: 3
  113. periodSeconds: 3
  114. resources:
  115. requests:
  116. memory: "0"
  117. limits:
  118. memory: "256Mi"
  119. ---
  120. apiVersion: v1
  121. kind: Service
  122. metadata:
  123. name: qbittorrentvpn-service
  124. namespace: plex
  125. spec:
  126. selector:
  127. app: qbittorrentvpn
  128. type: ClusterIP
  129. ports:
  130. - name: qbittorrentvpn-web-port
  131. protocol: TCP
  132. port: 8080
  133. targetPort: http-web-svc
  134. ---
  135. apiVersion: v1
  136. kind: Service
  137. metadata:
  138. name: qbittorrentvpn-exporter-service
  139. namespace: plex
  140. labels:
  141. app: qbittorrentvpn-exporter
  142. spec:
  143. selector:
  144. app: qbittorrentvpn-exporter
  145. type: ClusterIP
  146. ports:
  147. - name: metrics
  148. protocol: TCP
  149. port: 8000
  150. targetPort: metrics
  151. ---
  152. apiVersion: networking.k8s.io/v1
  153. kind: Ingress
  154. metadata:
  155. name: qbittorrentvpn
  156. namespace: plex
  157. annotations:
  158. traefik.ingress.kubernetes.io/router.entrypoints: websecure
  159. traefik.ingress.kubernetes.io/router.middlewares: kube-system-lanonly@kubernetescrd
  160. spec:
  161. rules:
  162. - host: qbittorrentvpn.lan.jibby.org
  163. http:
  164. paths:
  165. - path: /
  166. pathType: Prefix
  167. backend:
  168. service:
  169. name: qbittorrentvpn-service
  170. port:
  171. number: 8080
  172. ---
  173. apiVersion: monitoring.coreos.com/v1
  174. kind: PrometheusRule
  175. metadata:
  176. labels:
  177. prometheus: qbittorrent
  178. role: alert-rules
  179. name: prometheus-qbittorrent-rules
  180. namespace: plex
  181. spec:
  182. groups:
  183. - name: ./qbittorrent.rules
  184. rules:
  185. - alert: QbittorrentErroredTorrents
  186. expr: sum(qbittorrent_torrents_count{status="error"}) > 0