[jackett] Add torrent-blackhole volume (#165)

Signed-off-by: Julien DOCHE <julien.doche@gmail.com>
This commit is contained in:
Julien DOCHE 2020-03-09 11:08:16 +01:00 committed by GitHub
parent a2f4de737f
commit 71bcd78fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 1 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v0.12.1582-ls39 appVersion: v0.12.1582-ls39
description: API Support for your favorite torrent trackers description: API Support for your favorite torrent trackers
name: jackett name: jackett
version: 2.0.2 version: 2.1.0
keywords: keywords:
- jackett - jackett
- torrent - torrent

View File

@ -65,6 +65,13 @@ The following tables lists the configurable parameters of the Sentry chart and t
| `persistence.config.subPath` | Mount a sub directory of the persistent volume if set | `""` | | `persistence.config.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.config.storageClass` | Type of persistent volume claim | `-` | | `persistence.config.storageClass` | Type of persistent volume claim | `-` |
| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` | | `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.torrentblackhole.enabled` | Use persistent volume to store torrent files | `true` |
| `persistence.torrentblackhole.size` | Size of persistent volume claim | `1Gi` |
| `persistence.torrentblackhole.existingClaim`| Use an existing PVC to persist data | `nil` |
| `persistence.torrentblackhole.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.torrentblackhole.storageClass` | Type of persistent volume claim | `-` |
| `persistence.torrentblackhole.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.extraExistingClaimMounts` | Optionally add multiple existing claims | `[]` |
| `resources` | CPU/Memory resource requests/limits | `{}` | | `resources` | CPU/Memory resource requests/limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` | | `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` | | `tolerations` | Toleration labels for pod assignment | `[]` |

View File

@ -65,6 +65,16 @@ spec:
{{- if .Values.persistence.config.subPath }} {{- if .Values.persistence.config.subPath }}
subPath: "{{ .Values.persistence.config.subPath }}" subPath: "{{ .Values.persistence.config.subPath }}"
{{- end }} {{- end }}
- mountPath: /downloads
name: torrentblackhole
{{- if .Values.persistence.torrentblackhole.subPath }}
subPath: "{{ .Values.persistence.torrentblackhole.subPath }}"
{{- end }}
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- end }}
resources: resources:
{{ toYaml .Values.resources | indent 12 }} {{ toYaml .Values.resources | indent 12 }}
volumes: volumes:
@ -75,6 +85,18 @@ spec:
{{- else }} {{- else }}
emptyDir: {} emptyDir: {}
{{ end }} {{ end }}
- name: torrentblackhole
{{- if .Values.persistence.torrentblackhole.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.torrentblackhole.existingClaim }}{{ .Values.persistence.torrentblackhole.existingClaim }}{{- else }}{{ template "jackett.fullname" . }}-torrentblackhole{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}

View File

@ -0,0 +1,25 @@
{{- if and .Values.persistence.torrentblackhole.enabled (not .Values.persistence.torrentblackhole.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "jackett.fullname" . }}-torrentblackhole
labels:
app.kubernetes.io/name: {{ include "jackett.name" . }}
helm.sh/chart: {{ include "jackett.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.torrentblackhole.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.torrentblackhole.size | quote }}
{{- if .Values.persistence.torrentblackhole.storageClass }}
{{- if (eq "-" .Values.persistence.torrentblackhole.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.torrentblackhole.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}

View File

@ -86,6 +86,23 @@ persistence:
## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs). ## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs).
## ##
subPath: "" subPath: ""
torrentblackhole:
enabled: true
## Jackett torrentblackhole directory volume configuration
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
# subPath: some-subpath
accessMode: ReadWriteOnce
size: 1Gi
resources: {} resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious