[qbittorrent] use common chart (#132)

This commit is contained in:
Bernd Schörgers 2020-11-09 15:58:00 +01:00 committed by GitHub
parent 55b0fb9c71
commit e2bb17f069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 110 additions and 135 deletions

View File

@ -1,8 +1,8 @@
apiVersion: v2
appVersion: 4.2.5
appVersion: 4.3.0
description: qBittorrent is a cross-platform free and open-source BitTorrent client
name: qbittorrent
version: 5.0.1
version: 6.0.0
keywords:
- qbittorrent
- torrrent
@ -14,7 +14,6 @@ maintainers:
- name: billimek
email: jeff@billimek.com
dependencies:
- name: media-common
- name: common
repository: https://k8s-at-home.com/charts/
version: ^1.0.0
alias: qbittorrent
version: ^1.0.5

View File

@ -1,6 +1,6 @@
# qBittorrent client
# qBittorrent
This is a helm chart for [qbittorrent](https://qbittorrent.org/) leveraging the [Linuxserver.io image](https://hub.docker.com/r/linuxserver/qbittorrent/)
This is a helm chart for [qbittorrent](https://qbittorrent.org/).
## TL;DR;
@ -32,27 +32,25 @@ helm delete my-release --purge
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
Read through the media-common [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/media-common/values.yaml)
Read through the charts [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/qbittorrent/values.yaml)
file. It has several commented out suggested values.
Additionally you can take a look at the common library [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/common/values.yaml) for more (advanced) configuration options.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
helm install qbittorrent \
--set qbittorrent.env.TZ="America/New York" \
helm install my-release \
--set env.TZ="America/New York" \
k8s-at-home/qbittorrent
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the
chart. For example,
```console
helm install qbittorrent k8s-at-home/qbittorrent --values values.yaml
helm install my-release k8s-at-home/qbittorrent --values values.yaml
```
These values will be nested as it is a dependency, for example
```yaml
qbittorrent:
image:
tag: ...
image:
tag: ...
```
---
@ -65,3 +63,18 @@ Error: rendered manifests contain a resource that already exists. Unable to cont
it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`.
---
## Upgrading an existing Release to a new major version
A major chart version change (like 4.0.1 -> 5.0.0) indicates that there is an incompatible breaking change potentially needing manual actions.
### Upgrading from 5.x.x to 6.x.x
Due to migrating to a centralized common library some values in `values.yaml` have changed.
Examples:
* `service.port` has been moved to `service.port.port`.
* `persistence.type` has been moved to `controllerType`.
Refer to the library values.yaml for more configuration options.

View File

@ -1,12 +1,2 @@
qbittorrent:
image:
organization: linuxserver
repository: qbittorrent
tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls91
service:
type: ClusterIP
port: 8080
ingress:
enabled: false
ingress:
enabled: true

View File

@ -1,23 +1 @@
{{- $svcPort := .Values.qbittorrent.service.port -}}
1. Get the application URL by running these commands:
{{- if .Values.qbittorrent.ingress.enabled }}
{{- range .Values.qbittorrent.ingress.hosts }}
http{{ if $.Values.qbittorrent.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.qbittorrent.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.qbittorrent.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "media-common.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.qbittorrent.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ include "media-common.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "media-common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ $svcPort }}
{{- else if contains "ClusterIP" .Values.qbittorrent.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "media-common.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:{{ $svcPort }}
{{- end }}
The default login to the GUI is login:admin, password:adminadmin
You should change this as soon as possible!
{{- include "common.notes.defaultNotes" . -}}

View File

@ -0,0 +1 @@
{{ include "common.all" . }}

View File

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

View File

@ -1,22 +0,0 @@
{{- if and .Values.qbittorrent.persistence.downloads.enabled (not .Values.qbittorrent.persistence.downloads.existingClaim) }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "media-common.fullname" . }}-downloads
{{- if .Values.qbittorrent.persistence.downloads.skipuninstall }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
labels:
{{- include "media-common.labels" . | nindent 4 }}
spec:
accessModes:
- {{ .Values.qbittorrent.persistence.downloads.accessMode | quote }}
resources:
requests:
storage: {{ .Values.qbittorrent.persistence.downloads.size | quote }}
{{- if .Values.qbittorrent.persistence.downloads.storageClass }}
storageClassName: {{ if (eq "-" .Values.qbittorrent.persistence.downloads.storageClass) }}""{{- else }}{{ .Values.qbittorrent.persistence.downloads.storageClass | quote}}{{- end }}
{{- end }}
{{- end -}}

View File

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

View File

@ -1,22 +1,21 @@
# Default values for qbittorrent.
qbittorrent:
image:
organization: linuxserver
repository: qbittorrent
pullPolicy: IfNotPresent
tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls91
image:
repository: linuxserver/qbittorrent
pullPolicy: IfNotPresent
tag: version-4.3.0202010181232-7086-1c663adeeubuntu18.04.1
env:
TZ: UTC
PUID: "1001"
PGID: "1001"
UMASK: "022"
env: {}
# TZ: UTC
# PUID: 1001
# PGID: 1001
# UMASK: 022
service:
service:
port:
port: 8080
btService:
bittorrent:
type: ClusterIP
port: 6881
## Specify the nodePort value for the LoadBalancer and NodePort service types.
@ -31,36 +30,53 @@ qbittorrent:
labels: {}
additionalSpec: {}
persistence:
downloads:
enabled: false
## qbittorrent downloads Persistent Volume Storage Class
## 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: "-"
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
# skipuninstall: false
persistence:
config:
enabled: false
emptyDir: false
additionalVolumes:
- name: qbittorrent-scripts
emptyDir: {}
## When you want to enable automatic port configuration at startup, adjust this to:
# configMap:
# name: <RELEASENAME>-scripts
# defaultMode: 511
- name: downloads
emptyDir: {}
## When using persistence.downloads.enabled: true, adjust this to:
# persistentVolumeClaim:
# claimName: qbittorrent-downloads
media:
enabled: false
emptyDir: false
mountPath: /media
## Persistent Volume Storage Class
## 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: "-"
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
# skipuninstall: false
# existingClaim: ""
additionalVolumeMounts:
- mountPath: /config/custom-cont-init.d
name: qbittorrent-scripts
- name: downloads
mountPath: /downloads
downloads:
enabled: false
emptyDir: false
mountPath: /downloads
## Persistent Volume Storage Class
## 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: "-"
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
# skipuninstall: false
# existingClaim: ""
additionalVolumes:
- name: qbittorrent-scripts
emptyDir: {}
## When you want to enable automatic port configuration at startup, adjust this to:
# configMap:
# name: <RELEASENAME>-scripts
# defaultMode: 511
additionalVolumeMounts:
- mountPath: /config/custom-cont-init.d
name: qbittorrent-scripts