[qbittorrent] No longer require additionalports

This commit is contained in:
bjws 2020-09-24 13:08:29 +02:00
parent e3e42eea31
commit 571372c4c7
No known key found for this signature in database
GPG Key ID: A03DFA2C45B4BD93
3 changed files with 50 additions and 10 deletions

View File

@ -5,11 +5,11 @@ metadata:
labels: labels:
{{- include "media-common.labels" . | nindent 4 }} {{- include "media-common.labels" . | nindent 4 }}
data: data:
{{- if .Values.qbittorrent.service.additionalPorts.bittorrent }} {{- if and .Values.qbittorrent.btService .Values.qbittorrent.btService.port }}
31-update-port: |- 31-update-port: |-
#!/bin/bash #!/bin/bash
QBITTORRENT_CONFIGFILE="/config/qBittorrent/qBittorrent.conf" QBITTORRENT_CONFIGFILE="/config/qBittorrent/qBittorrent.conf"
INCOMING_PORT={{- .Values.qbittorrent.service.additionalPorts.bittorrent.port }} INCOMING_PORT={{- .Values.qbittorrent.btService.port }}
incoming_port_exist=$(cat ${QBITTORRENT_CONFIGFILE} | grep -m 1 'Connection\\PortRangeMin='${INCOMING_PORT}) incoming_port_exist=$(cat ${QBITTORRENT_CONFIGFILE} | grep -m 1 'Connection\\PortRangeMin='${INCOMING_PORT})
if [[ -z "${incoming_port_exist}" ]]; then if [[ -z "${incoming_port_exist}" ]]; then

View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "media-common.fullname" . }}-bittorrent
labels:
{{- include "media-common.labels" . | nindent 4 }}
{{- if .Values.qbittorrent.btService.labels }}
{{ toYaml .Values.qbittorrent.btService.labels | indent 4 }}
{{- end }}
{{- with .Values.qbittorrent.btService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.qbittorrent.btService.type }}
ports:
- name: bittorrent
port: {{ .Values.qbittorrent.btService.port }}
protocol: TCP
targetPort: {{ .Values.qbittorrent.btService.port }}
{{- if (and (eq .Values.qbittorrent.btService.type "NodePort") (not (empty .Values.qbittorrent.btService.nodePort))) }}
nodePort: {{ .Values.qbittorrent.btService.nodePort }}
{{- end }}
{{- with .Values.qbittorrent.btService.additionalSpec }}
{{- toYaml . | nindent 2 }}
{{- end }}
selector:
{{- include "media-common.selectorLabels" . | nindent 4 }}

View File

@ -7,17 +7,29 @@ qbittorrent:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls91 tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls91
env: {} env:
# TZ: UTC TZ: UTC
# PUID: 1001 PUID: 1001
# PGID: 1001 PGID: 1001
# UMASK: 022 UMASK: 022
service: service:
port: 8080 port: 8080
additionalPorts:
bittorrent: btService:
port: 6881 type: ClusterIP
port: 6881
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort:
## Provide any additional annotations which may be required. This can be used to
## set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
annotations: {}
labels: {}
additionalSpec: {}
persistence: persistence:
downloads: downloads: