Compare commits

...

10 Commits

Author SHA1 Message Date
Nicholas St. Germain
90a691aea0 Merge pull request #66 from dcplaya/media-common
[media-common] Add initContainers
2020-09-26 22:36:23 -05:00
Drew
3ee806f563 [media-common] Wrap in conditional statement
Had a feeling I needed this!
2020-09-26 18:36:54 -07:00
Drew
374b098436 [media-common] Fix version 2020-09-25 23:58:35 -07:00
Drew
e63dbd08d1 [media-common] Forgot this
Not sure if this is why the lint is angry but lets give her a try
2020-09-25 23:50:05 -07:00
Drew
2c15d6617c [media-common] Add initContainers
I think this is all thats needed to get this working
2020-09-25 23:33:12 -07:00
Nicholas St. Germain
aca509001d Merge pull request #63 from bjw-s/qbittorrent
[qbittorrent] Migrate to media-common
2020-09-26 01:15:56 -05:00
Nicholas St. Germain
053d99b0fe Merge branch 'master' into qbittorrent 2020-09-26 01:10:40 -05:00
bjws
47c37d6ad8 [qbittorrent] Fix env strings 2020-09-24 13:31:52 +02:00
bjws
571372c4c7 [qbittorrent] No longer require additionalports 2020-09-24 13:08:29 +02:00
bjws
e3e42eea31 [qbittorrent] Migrate to media-common 2020-09-24 10:56:51 +02:00
20 changed files with 205 additions and 578 deletions

View File

@@ -2,7 +2,7 @@ apiVersion: v2
name: media-common
description: Common dependancy chart for media ecosystem containers
type: application
version: 1.1.1
version: 1.2.0
keywords:
- media-common
home: https://github.com/k8s-at-home/charts/tree/master/charts/media-common

View File

@@ -51,6 +51,15 @@ app.kubernetes.io/name: {{ include "media-common.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Init Containers
*/}}
{{- define "media-common.initContainers" -}}
{{- if .Values.initContainers }}
{{- toYaml .Values.initContainers }}
{{- end }}
{{- end -}}
{{/*
Additional Containers
*/}}

View File

@@ -27,6 +27,10 @@ spec:
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- include "media-common.initContainers" . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "media-common.fullname" . }}
{{- with .Values.securityContext }}

View File

@@ -28,6 +28,10 @@ spec:
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- include "media-common.initContainers" . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "media-common.fullname" . }}
{{- with .Values.securityContext }}

View File

@@ -113,6 +113,8 @@ persistence:
## Do not delete the pvc upon helm uninstall
skipuninstall: false
initContainers: []
additionalContainers: []
additionalVolumes: []

View File

@@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 4.2.5
description: qBittorrent is a cross-platform free and open-source BitTorrent client
name: qbittorrent
version: 4.0.1
version: 5.0.0
keywords:
- qbittorrent
- torrrent
@@ -13,3 +13,8 @@ sources:
maintainers:
- name: billimek
email: jeff@billimek.com
dependencies:
- name: media-common
repository: https://k8s-at-home.com/charts/
version: ^1.0.0
alias: qbittorrent

View File

@@ -20,7 +20,7 @@ helm install --name my-release k8s-at-home/qbittorrent
The default login details (change ASAP) are:
* login:admin
* password:admin
* password:adminadmin
## Uninstalling the Chart
@@ -33,82 +33,35 @@ helm delete my-release --purge
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
The following tables lists the configurable parameters of the Sentry chart and their default values.
| Parameter | Description | Default |
|----------------------------|-------------------------------------|---------------------------------------------------------|
| `image.repository` | Image repository | `linuxserver/qbittorrent` |
| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/linuxserver/qbittorrent/tags/).| `14.2.0.99201912180418-6819-118af03ubuntu18.04.1-ls57`|
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` |
| `timezone` | Timezone the qbittorrent instance should run as, e.g. 'America/New_York' | `UTC` |
| `puid` | process userID the qbittorrent instance should run as | `1001` |
| `pgid` | process groupID the qbittorrent instance should run as | `1001` |
| `umask` | newly created files should be set to this umask value | `022` |
| `probes.liveness.initialDelaySeconds` | Specify liveness `initialDelaySeconds` parameter for the deployment | `60` |
| `probes.liveness.failureThreshold` | Specify liveness `failureThreshold` parameter for the deployment | `5` |
| `probes.liveness.timeoutSeconds` | Specify liveness `timeoutSeconds` parameter for the deployment | `10` |
| `probes.readiness.initialDelaySeconds` | Specify readiness `initialDelaySeconds` parameter for the deployment | `60` |
| `probes.readiness.failureThreshold` | Specify readiness `failureThreshold` parameter for the deployment | `5` |
| `probes.readiness.timeoutSeconds` | Specify readiness `timeoutSeconds` parameter for the deployment | `10` |
| `guiService.type` | Kubernetes service type for the qbittorrent GUI | `ClusterIP` |
| `guiService.port` | Kubernetes port where the qbittorrent GUI is exposed| `8080` |
| `guiService.annotations` | Service annotations for the qbittorrent GUI | `{}` |
| `guiService.labels` | Custom labels | `{}` |
| `guiService.loadBalancerIP` | Loadbalance IP for the qbittorrent GUI | `{}` |
| `btService.type` | Kubernetes service type for the qbittorrent listening bittorrent port | `NodePort` |
| `btService.port` | Kubernetes port where the qbittorrent listening bittorrent port | `6881` |
| `btService.annotations` | Service annotations for the qbittorrent bittorrent protocol | `{}` |
| `btService.labels` | Custom labels | `{}` |
| `btService.loadBalancerIP` | Loadbalance IP for the qbittorrent bittorrent protocol | `{}` |
| `ingress.enabled` | Enables Ingress | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.labels` | Custom labels | `{}`
| `ingress.path` | Ingress path | `/` |
| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` |
| `ingress.tls` | Ingress TLS configuration | `[]` |
| `persistence.config.enabled` | Use persistent volume to store configuration data | `true` |
| `persistence.config.size` | Size of persistent volume claim | `1Gi` |
| `persistence.config.existingClaim`| Use an existing PVC to persist data | `nil` |
| `persistence.config.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.config.storageClass` | Type of persistent volume claim | `-` |
| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.config.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` |
| `persistence.downloads.enabled` | Use persistent volume to store configuration data | `true` |
| `persistence.downloads.size` | Size of persistent volume claim | `10Gi` |
| `persistence.downloads.existingClaim`| Use an existing PVC to persist data | `nil` |
| `persistence.downloads.subPath` | Mount a sub directory of the persistent volume if set | `""` |
| `persistence.downloads.storageClass` | Type of persistent volume claim | `-` |
| `persistence.downloads.accessMode` | Persistence access mode | `ReadWriteOnce` |
| `persistence.downloads.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` |
| `persistence.extraMounts` | Array of additional claims to mount | `[]` |
| `resources` | CPU/Memory resource requests/limits | `{}` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` |
| `affinity` | Affinity settings for pod assignment | `{}` |
| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` |
| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` |
Read through the media-common [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/media-common/values.yaml)
file. It has several commented out suggested values.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
helm install --name my-release \
--set timezone="America/New York" \
helm install qbittorrent \
--set qbittorrent.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,
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the
chart. For example,
```console
helm install --name my-release -f values.yaml k8s-at-home/qbittorrent
helm install qbittorrent k8s-at-home/qbittorrent --values values.yaml
```
These values will be nested as it is a dependency, for example
```yaml
qbittorrent:
image:
tag: ...
```
---
**NOTE**
If you get `Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: ...` it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`.
If you get
```console
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: ...`
```
it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`.
---
Read through the [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/qbittorrent/values.yaml) file. It has several commented out suggested values.

View File

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

View File

@@ -1,19 +1,23 @@
{{- $svcPort := .Values.qbittorrent.service.port -}}
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- 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.guiService.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "qbittorrent.fullname" . }})
{{- 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.guiService.type }}
{{- 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 "qbittorrent.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "qbittorrent.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.guiService.port }}
{{- else if contains "ClusterIP" .Values.guiService.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "qbittorrent.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
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:80
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!

View File

@@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "qbittorrent.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "qbittorrent.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "qbittorrent.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -1,52 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "qbittorrent.fullname" . }}-bt
labels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
helm.sh/chart: {{ include "qbittorrent.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.btService.labels }}
{{ toYaml .Values.btService.labels | indent 4 }}
{{- end }}
{{- with .Values.btService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.btService.type "ClusterIP") (empty .Values.btService.type)) }}
type: ClusterIP
{{- if .Values.btService.clusterIP }}
clusterIP: {{ .Values.btService.clusterIP }}
{{end}}
{{- else if eq .Values.btService.type "LoadBalancer" }}
type: {{ .Values.btService.type }}
{{- if .Values.btService.loadBalancerIP }}
loadBalancerIP: {{ .Values.btService.loadBalancerIP }}
{{- end }}
{{- if .Values.btService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.btService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.btService.type }}
{{- end }}
{{- if .Values.btService.externalIPs }}
externalIPs:
{{ toYaml .Values.btService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.btService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.btService.externalTrafficPolicy }}
{{- end }}
ports:
- name: bt
port: {{ .Values.btService.port }}
protocol: TCP
targetPort: bt
{{ if (and (eq .Values.btService.type "NodePort") (not (empty .Values.btService.nodePort))) }}
nodePort: {{.Values.btService.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

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

View File

@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "media-common.fullname" . }}-scripts
labels:
{{- include "media-common.labels" . | nindent 4 }}
data:
{{- if and .Values.qbittorrent.btService .Values.qbittorrent.btService.port }}
31-update-port: |-
#!/bin/bash
QBITTORRENT_CONFIGFILE="/config/qBittorrent/qBittorrent.conf"
INCOMING_PORT={{- .Values.qbittorrent.btService.port }}
incoming_port_exist=$(cat ${QBITTORRENT_CONFIGFILE} | grep -m 1 'Connection\\PortRangeMin='${INCOMING_PORT})
if [[ -z "${incoming_port_exist}" ]]; then
incoming_exist=$(cat ${QBITTORRENT_CONFIGFILE} | grep -m 1 'Connection\\PortRangeMin')
if [[ ! -z "${incoming_exist}" ]]; then
# Get line number of Incoming
LINE_NUM=$(grep -Fn -m 1 'Connection\PortRangeMin' ${QBITTORRENT_CONFIGFILE} | cut -d: -f 1)
sed -i "${LINE_NUM}s@.*@Connection\\\PortRangeMin=${INCOMING_PORT}@" ${QBITTORRENT_CONFIGFILE}
else
echo "Connection\\PortRangeMin=${INCOMING_PORT}" >> ${QBITTORRENT_CONFIGFILE}
fi
fi
{{- end }}

View File

@@ -1,117 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "qbittorrent.fullname" . }}
{{- if .Values.deploymentAnnotations }}
annotations:
{{- range $key, $value := .Values.deploymentAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
helm.sh/chart: {{ include "qbittorrent.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: {{ .Values.strategyType }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: bt
containerPort: 6881
protocol: TCP
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
tcpSocket:
port: bt
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
readinessProbe:
tcpSocket:
port: bt
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
env:
- name: TZ
value: "{{ .Values.timezone }}"
- name: PUID
value: "{{ .Values.puid }}"
- name: PGID
value: "{{ .Values.pgid }}"
- name: UMASK_SET
value: "{{ .Values.umask }}"
volumeMounts:
- mountPath: /config
name: config
{{- if .Values.persistence.config.subPath }}
subPath: {{ .Values.persistence.config.subPath }}
{{ end }}
- mountPath: /downloads
name: downloads
{{- if .Values.persistence.downloads.subPath }}
subPath: {{ .Values.persistence.downloads.subPath }}
{{ end }}
{{- range .Values.persistence.extraMounts }}
- mountPath: /{{ .name }}
name: {{ .name }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
volumes:
- name: config
{{- if .Values.persistence.config.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "qbittorrent.fullname" . }}-config{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
- name: downloads
{{- if .Values.persistence.downloads.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.downloads.existingClaim }}{{ .Values.persistence.downloads.existingClaim }}{{- else }}{{ template "qbittorrent.fullname" . }}-downloads{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
{{- range .Values.persistence.extraMounts }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .claimName }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

View File

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

View File

@@ -1,52 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "qbittorrent.fullname" . }}-gui
labels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
helm.sh/chart: {{ include "qbittorrent.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.guiService.labels }}
{{ toYaml .Values.guiService.labels | indent 4 }}
{{- end }}
{{- with .Values.guiService.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.guiService.type "ClusterIP") (empty .Values.guiService.type)) }}
type: ClusterIP
{{- if .Values.guiService.clusterIP }}
clusterIP: {{ .Values.guiService.clusterIP }}
{{end}}
{{- else if eq .Values.guiService.type "LoadBalancer" }}
type: {{ .Values.guiService.type }}
{{- if .Values.guiService.loadBalancerIP }}
loadBalancerIP: {{ .Values.guiService.loadBalancerIP }}
{{- end }}
{{- if .Values.guiService.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.guiService.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.guiService.type }}
{{- end }}
{{- if .Values.guiService.externalIPs }}
externalIPs:
{{ toYaml .Values.guiService.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.guiService.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.guiService.externalTrafficPolicy }}
{{- end }}
ports:
- name: http
port: {{ .Values.guiService.port }}
protocol: TCP
targetPort: http
{{ if (and (eq .Values.guiService.type "NodePort") (not (empty .Values.guiService.nodePort))) }}
nodePort: {{.Values.guiService.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@@ -1,41 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "qbittorrent.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "qbittorrent.name" . }}
helm.sh/chart: {{ include "qbittorrent.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.labels -}}
{{ toYaml . | nindent 4 }}
{{- end -}}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}-gui
servicePort: http
{{- end }}
{{- end }}

View File

@@ -0,0 +1,22 @@
{{- 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

@@ -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

@@ -1,157 +1,66 @@
# Default values for qbittorrent.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# upgrade strategy type (e.g. Recreate or RollingUpdate)
strategyType: Recreate
qbittorrent:
image:
organization: linuxserver
repository: qbittorrent
pullPolicy: IfNotPresent
tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls91
# Probes configuration
probes:
liveness:
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
readiness:
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 10
env:
TZ: UTC
PUID: "1001"
PGID: "1001"
UMASK: "022"
nameOverride: ""
fullnameOverride: ""
service:
port: 8080
# timezone: UTC
puid: 1001
pgid: 1001
umask: 022
image:
repository: linuxserver/qbittorrent
tag: 14.2.5.99202004250119-7015-2c65b79ubuntu18.04.1-ls89
pullPolicy: IfNotPresent
# resources:
# requests:
# cpu: "50m"
# memory: "50Mi"
# limits:
# memory: "1Gi"
guiService:
type: ClusterIP
port: 8080
## 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: {}
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank
##
loadBalancerIP:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster
btService:
type: NodePort
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: {}
## Use loadBalancerIP to request a specific static IP,
## otherwise leave blank
##
loadBalancerIP:
# loadBalancerSourceRanges: []
## Set the externalTrafficPolicy in the Service to either Cluster or Local
# externalTrafficPolicy: Cluster
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
persistence:
config:
enabled: true
## qbittorrent configuration data 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)
btService:
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
##
# storageClass: "-"
# 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
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
accessMode: ReadWriteOnce
size: 1Gi
## If subPath is set mount a sub folder of a volume instead of the root of the volume.
## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs).
##
subPath: ""
## Do not delete the pvc upon helm uninstall
skipuninstall: false
downloads:
enabled: true
## qbittorrent torrents downloads 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: 10Gi
## If subPath is set mount a sub folder of a volume instead of the root of the volume.
## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs).
##
subPath: ""
## Do not delete the pvc upon helm uninstall
skipuninstall: false
annotations: {}
labels: {}
additionalSpec: {}
extraMounts: []
## Include additional claims that can be mounted inside the
## pod. This is useful if you wish to use different paths with categories
## Claim will me mounted as /{name}
# - name: video
# claimName: video-claim
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
nodeSelector: {}
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
tolerations: []
affinity: {}
podAnnotations: {}
deploymentAnnotations: {}
additionalVolumeMounts:
- mountPath: /config/custom-cont-init.d
name: qbittorrent-scripts
- name: downloads
mountPath: /downloads