From c2fb3b646bb5d3824cbc86f4db298d9c59d7e18f Mon Sep 17 00:00:00 2001 From: sHa Date: Sat, 11 Apr 2026 13:03:37 +0300 Subject: [PATCH] chore: Add qBittorrent Helm chart with deployment, service, ingress, and values files --- qbittorrent/Chart.yaml | 8 ++++ qbittorrent/templates/deployment.yaml | 61 +++++++++++++++++++++++++++ qbittorrent/templates/ingress.yaml | 27 ++++++++++++ qbittorrent/templates/service.yaml | 24 +++++++++++ qbittorrent/values.yaml | 34 +++++++++++++++ 5 files changed, 154 insertions(+) create mode 100644 qbittorrent/Chart.yaml create mode 100644 qbittorrent/templates/deployment.yaml create mode 100644 qbittorrent/templates/ingress.yaml create mode 100644 qbittorrent/templates/service.yaml create mode 100644 qbittorrent/values.yaml diff --git a/qbittorrent/Chart.yaml b/qbittorrent/Chart.yaml new file mode 100644 index 0000000..8119b81 --- /dev/null +++ b/qbittorrent/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: qbittorrent +description: qBittorrent Helm chart +type: application +version: 0.1.0 +appVersion: "5.1.4-r2-ls444" +annotations: + version-source: github-release:linuxserver/docker-qbittorrent diff --git a/qbittorrent/templates/deployment.yaml b/qbittorrent/templates/deployment.yaml new file mode 100644 index 0000000..a576af9 --- /dev/null +++ b/qbittorrent/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: torrent + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: WEBUI_PORT + value: {{ .Values.webuiPort | quote }} + - name: TORRENTING_PORT + value: {{ .Values.torrentPort | quote }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + ports: + - containerPort: {{ .Values.webuiPort }} + name: webui + - containerPort: {{ .Values.torrentPort }} + name: torrent-tcp + protocol: TCP + - containerPort: {{ .Values.torrentPort }} + name: torrent-udp + protocol: UDP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config + mountPath: /config + - name: downloads + mountPath: /downloads + volumes: + - name: config + hostPath: + path: {{ .Values.volumes.config.hostPath }} + type: DirectoryOrCreate + - name: downloads + hostPath: + path: {{ .Values.volumes.downloads.hostPath }} + type: DirectoryOrCreate diff --git a/qbittorrent/templates/ingress.yaml b/qbittorrent/templates/ingress.yaml new file mode 100644 index 0000000..62b56db --- /dev/null +++ b/qbittorrent/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.webuiPort }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/qbittorrent/templates/service.yaml b/qbittorrent/templates/service.yaml new file mode 100644 index 0000000..b69d4b3 --- /dev/null +++ b/qbittorrent/templates/service.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: webui + port: {{ .Values.webuiPort }} + targetPort: {{ .Values.webuiPort }} + protocol: TCP + - name: torrent-tcp + port: {{ .Values.torrentPort }} + targetPort: {{ .Values.torrentPort }} + protocol: TCP + - name: torrent-udp + port: {{ .Values.torrentPort }} + targetPort: {{ .Values.torrentPort }} + protocol: UDP diff --git a/qbittorrent/values.yaml b/qbittorrent/values.yaml new file mode 100644 index 0000000..d8854b3 --- /dev/null +++ b/qbittorrent/values.yaml @@ -0,0 +1,34 @@ +# Default values for qBittorrent Helm Chart +image: + repository: lscr.io/linuxserver/qbittorrent + pullPolicy: IfNotPresent + +webuiPort: 8080 +torrentPort: 6881 + +env: + PUID: "1001" + PGID: "1001" + TZ: "Europe/Kyiv" + +resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "2" + memory: "2Gi" + +volumes: + config: + hostPath: "" + downloads: + hostPath: "" + +ingresses: {} + # https: + # host: dl.example.com + # annotations: {} + # tls: + # - hosts: + # - dl.example.com