[rtorrent-flood] migrate to AIO image and common chart (#717)

* fix: rtorrent-flood

* fix: rtorrent-flood

* fix: newline

* fix: use latest
This commit is contained in:
ᗪєνιη ᗷυнʟ 2021-03-25 18:25:39 -04:00 committed by GitHub
parent 8ec4a9ab93
commit d8f9e8ce85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 314 additions and 608 deletions

View File

@ -19,5 +19,8 @@
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl

View File

@ -1,18 +1,24 @@
apiVersion: v2
appVersion: 1.0.0
description: rtorrent and flood co-located in the same deployment
appVersion: latest
description: rTorrent is a stable, high-performance and low resource consumption BitTorrent client.
name: rtorrent-flood
version: 5.0.2
version: 6.0.0
kubeVersion: ">=1.16.0-0"
keywords:
- rtorrent
- flood
- torrrent
- rtorrent
- flood
- torrent
home: https://github.com/k8s-at-home/charts/tree/master/charts/stable/rtorrent-flood
icon: https://github.com/jfurrow/flood/blob/master/flood.png?raw=true
sources:
- https://hub.docker.com/r/looselyrigorous/rtorrent
- https://github.com/looselyrigorous/docker-rtorrent
- https://github.com/Flood-UI/flood
- https://github.com/jesec/rtorrent
- https://github.com/jesec/flood
- https://hub.docker.com/r/jesec/rtorrent
- https://hub.docker.com/r/jesec/flood
maintainers:
- name: billimek
email: jeff@billimek.com
- name: billimek
email: jeff@billimek.com
dependencies:
- name: common
repository: https://library-charts.k8s-at-home.com
version: 2.0.1

View File

@ -1,23 +1,27 @@
# rtorrent-flood
![Version: 5.0.2](https://img.shields.io/badge/Version-5.0.2-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
![Version: 6.0.0](https://img.shields.io/badge/Version-6.0.0-informational?style=flat-square) ![AppVersion: v0.9.8-r8+v4.5.0](https://img.shields.io/badge/AppVersion-v0.9.8--r8+v4.5.0-informational?style=flat-square)
rtorrent and flood co-located in the same deployment
rTorrent is a stable, high-performance and low resource consumption BitTorrent client.
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)**
## Source Code
* <https://hub.docker.com/r/looselyrigorous/rtorrent>
* <https://github.com/looselyrigorous/docker-rtorrent>
* <https://github.com/Flood-UI/flood>
* <https://github.com/jesec/rtorrent>
* <https://github.com/jesec/flood>
* <https://hub.docker.com/r/jesec/rtorrent>
* <https://hub.docker.com/r/jesec/flood>
## Requirements
Kubernetes: `>=1.16.0-0`
## Dependencies
| Repository | Name | Version |
|------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 2.0.1 |
## TL;DR
@ -66,23 +70,7 @@ helm install rtorrent-flood k8s-at-home/rtorrent-flood -f values.yaml
## Custom configuration
### Setup
NB: This chart will start 2 containers in a single pod, when both containers are started, you will be able to configure flood.
1. Install the chart `helm install rtorrent k8s-at-home/rtorrent-flood`
2. Port-forward to the container `kubectl port-forward $(kubectl get pods -A -o json | jq '.items[] | select(.metadata.labels."app.kubernetes.io/name"=="rtorrent-flood")' | jq .metadata.name -r) 3000:3000`
3. To connect flood to rtorrent, provide the socket path : `/tmp/rtorrent.sock`
4. When connected with flood to rtorrent, go to the settings and change the download path to `/data` which is set by default by the chart
5. You should be able to start downloading torrents now :)
### Pitfalls
You may need to change the StorageClass depending on your kubernetes setup or the containers won't start, use a custom `values.yaml` file to do so.
N/A
## Values
@ -90,53 +78,27 @@ You may need to change the StorageClass depending on your kubernetes setup or th
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| btService.annotations | object | `{}` | |
| btService.labels | object | `{}` | |
| btService.loadBalancerIP | string | `nil` | |
| btService.port | int | `49161` | |
| btService.type | string | `"NodePort"` | |
| flood.enabled | bool | `true` | |
| flood.image.pullPolicy | string | `"Always"` | |
| flood.image.repository | string | `"jfurrow/flood-ui"` | |
| flood.image.tag | string | `"latest"` | |
| flood.resources.limits.memory | string | `"250Mi"` | |
| flood.resources.requests.cpu | string | `"10m"` | |
| flood.resources.requests.memory | string | `"100Mi"` | |
| floodSecret | string | `"supersecret"` | |
| fullnameOverride | string | `""` | |
| gid | int | `1001` | |
| guiService.annotations | object | `{}` | |
| guiService.labels | object | `{}` | |
| guiService.loadBalancerIP | string | `nil` | |
| guiService.port | int | `3000` | |
| guiService.type | string | `"ClusterIP"` | |
| ingress.annotations | object | `{}` | |
| args[0] | string | `"--port 3000"` | |
| args[1] | string | `"--allowedpath /downloads"` | |
| config | string | see URL to default config | Minimal configuration provided from https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc |
| env.HOME | string | `"/config"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"jesec/rtorrent-flood"` | |
| image.tag | string | `"latest"` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0] | string | `"chart-example.local"` | |
| ingress.path | string | `"/"` | |
| ingress.tls | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| persistence.config.accessMode | string | `"ReadWriteOnce"` | |
| persistence.config.enabled | bool | `true` | |
| persistence.config.size | string | `"1Gi"` | |
| persistence.config.skipuninstall | bool | `false` | |
| persistence.data.accessMode | string | `"ReadWriteOnce"` | |
| persistence.data.enabled | bool | `true` | |
| persistence.data.size | string | `"10Gi"` | |
| persistence.data.skipuninstall | bool | `false` | |
| podAnnotations | object | `{}` | |
| rtorrent.enabled | bool | `true` | |
| rtorrent.image.pullPolicy | string | `"Always"` | |
| rtorrent.image.repository | string | `"billimek/rtorrent"` | |
| rtorrent.image.tag | string | `"latest"` | |
| rtorrent.resources.limits.memory | string | `"1Gi"` | |
| rtorrent.resources.requests.cpu | string | `"50m"` | |
| rtorrent.resources.requests.memory | string | `"50Mi"` | |
| strategyType | string | `"Recreate"` | |
| tolerations | list | `[]` | |
| uid | int | `1001` | |
| persistence.config.emptyDir.enabled | bool | `false` | |
| persistence.config.enabled | bool | `false` | |
| persistence.downloads.emptyDir.enabled | bool | `false` | |
| persistence.downloads.enabled | bool | `false` | |
| service.additionalServices[0].enabled | bool | `true` | |
| service.additionalServices[0].nameSuffix | string | `"bittorrent"` | |
| service.additionalServices[0].port.name | string | `"bittorrent"` | |
| service.additionalServices[0].port.port | int | `6881` | |
| service.additionalServices[0].port.protocol | string | `"TCP"` | |
| service.additionalServices[0].port.targetPort | int | `6881` | |
| service.additionalServices[0].type | string | `"ClusterIP"` | |
| service.port.port | int | `3000` | |
| strategy.type | string | `"Recreate"` | |
## Changelog
@ -144,6 +106,20 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [6.0.0]
#### Added
- N/A
#### Changed
- **BREAKING** Migrate rtorrent-flood to the common library, a lot of configuration has changed.
#### Removed
- N/A
### [5.0.1]
#### Added
@ -158,6 +134,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A
[6.0.0]: #6.0.0
[5.0.1]: #5.0.1
## Support

View File

@ -9,6 +9,20 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [6.0.0]
#### Added
- N/A
#### Changed
- **BREAKING** Migrate rtorrent-flood to the common library, a lot of configuration has changed.
#### Removed
- N/A
### [5.0.1]
#### Added
@ -23,5 +37,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A
[6.0.0]: #6.0.0
[5.0.1]: #5.0.1
{{- end -}}

View File

@ -5,22 +5,5 @@
{{- define "custom.custom.configuration" -}}
{{ template "custom.custom.configuration.header" . }}
### Setup
NB: This chart will start 2 containers in a single pod, when both containers are started, you will be able to configure flood.
1. Install the chart `helm install rtorrent k8s-at-home/rtorrent-flood`
2. Port-forward to the container `kubectl port-forward $(kubectl get pods -A -o json | jq '.items[] | select(.metadata.labels."app.kubernetes.io/name"=="rtorrent-flood")' | jq .metadata.name -r) 3000:3000`
3. To connect flood to rtorrent, provide the socket path : `/tmp/rtorrent.sock`
4. When connected with flood to rtorrent, go to the settings and change the download path to `/data` which is set by default by the chart
5. You should be able to start downloading torrents now :)
### Pitfalls
You may need to change the StorageClass depending on your kubernetes setup or the containers won't start, use a custom `values.yaml` file to do so.
N/A
{{- end -}}

View File

@ -0,0 +1,9 @@
persistence:
config:
enabled: true
emptyDir:
enabled: true
downloads:
enabled: true
emptyDir:
enabled: true

View File

@ -1,19 +1 @@
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 }}
{{- end }}
{{- else if contains "NodePort" .Values.guiService.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "rtorrent-flood.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 }}
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 "rtorrent-flood.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "rtorrent-flood.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 "rtorrent-flood.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
{{- end }}
{{- include "common.notes.defaultNotes" . -}}

View File

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "rtorrent-flood.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 "rtorrent-flood.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 "rtorrent-flood.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 "rtorrent-flood.fullname" . }}-bt
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
helm.sh/chart: {{ include "rtorrent-flood.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 "rtorrent-flood.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@ -0,0 +1,31 @@
{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}
{{/* Append the configMap to the additionalVolumes */}}
{{- define "rtorrent-flood.configmap.volume" -}}
name: rtorrent-flood-config
configMap:
name: {{ template "common.names.fullname" . }}-config
{{- end -}}
{{- $volume := include "rtorrent-flood.configmap.volume" . | fromYaml -}}
{{- if $volume -}}
{{- $additionalVolumes := append .Values.additionalVolumes $volume }}
{{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}}
{{- end -}}
{{/* Append the configMap volume to the additionalVolumeMounts */}}
{{- define "rtorrent-flood.configmap.volumeMount" -}}
name: rtorrent-flood-config
mountPath: /config/.rtorrent.rc
subPath: .rtorrent.rc
{{- end -}}
{{- $volumeMount := include "rtorrent-flood.configmap.volumeMount" . | fromYaml -}}
{{- if $volumeMount -}}
{{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount }}
{{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "common.all" . }}

View File

@ -1,28 +0,0 @@
{{- if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "rtorrent-flood.fullname" . }}-config
{{- if .Values.persistence.config.skipuninstall }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
helm.sh/chart: {{ include "rtorrent-flood.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,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-config
labels:
{{- include "common.labels" . | nindent 4 }}
data:
rtorrent.rc: |
{{ .Values.config | indent 4 }}

View File

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

View File

@ -1,140 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "rtorrent-flood.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
helm.sh/chart: {{ include "rtorrent-flood.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 "rtorrent-flood.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.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 }}-rtorrent
image: "{{ .Values.rtorrent.image.repository }}:{{ .Values.rtorrent.image.tag }}"
imagePullPolicy: {{ .Values.rtorrent.image.pullPolicy }}
ports:
- name: bt
containerPort: 49161
protocol: TCP
tty: true
livenessProbe:
tcpSocket:
port: bt
readinessProbe:
tcpSocket:
port: bt
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
env:
- name: TZ
value: "{{ .Values.timezone }}"
- name: PUID
value: "{{ .Values.uid }}"
- name: PGID
value: "{{ .Values.gid }}"
volumeMounts:
- mountPath: /config
name: config
- mountPath: /data
name: data
{{- if .Values.persistence.data.subPath }}
subPath: {{ .Values.persistence.data.subPath }}
{{ end }}
- mountPath: /session
name: data
{{- if .Values.persistence.data.subPath }}
subPath: {{ .Values.persistence.data.subPath }}/.session
{{- else }}
subPath: .session
{{ end }}
- mountPath: /socket
name: socket
resources:
{{ toYaml .Values.rtorrent.resources | indent 12 }}
- name: {{ .Chart.Name }}-flood
image: "{{ .Values.flood.image.repository }}:{{ .Values.flood.image.tag }}"
imagePullPolicy: {{ .Values.flood.image.pullPolicy }}
ports:
- name: http
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
port: http
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 15
readinessProbe:
httpGet:
port: http
initialDelaySeconds: 60
failureThreshold: 5
timeoutSeconds: 20
# tty: true
env:
- name: TZ
value: "{{ .Values.timezone }}"
- name: FLOOD_SECRET
value: "{{ .Values.floodSecret }}"
- name: RTORRENT_SOCK
value: "true"
volumeMounts:
- mountPath: /data
name: data
{{- if .Values.persistence.data.subPath }}
subPath: {{ .Values.persistence.data.subPath }}
{{ end }}
- mountPath: /tmp
name: socket
resources:
{{ toYaml .Values.flood.resources | indent 12 }}
volumes:
- name: config
{{- if .Values.persistence.config.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "rtorrent-flood.fullname" . }}-config{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
- name: data
{{- if .Values.persistence.data.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.data.existingClaim }}{{ .Values.persistence.data.existingClaim }}{{- else }}{{ template "rtorrent-flood.fullname" . }}-data{{- end }}
{{- else }}
emptyDir: {}
{{ end }}
- name: socket
emptyDir: {}
{{- 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,52 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "rtorrent-flood.fullname" . }}-gui
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
helm.sh/chart: {{ include "rtorrent-flood.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 "rtorrent-flood.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@ -1,38 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "rtorrent-flood.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "rtorrent-flood.name" . }}
helm.sh/chart: {{ include "rtorrent-flood.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- 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

@ -1,143 +1,205 @@
# Default values for rtorrent-flood.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#
# upgrade strategy type (e.g. Recreate or RollingUpdate)
strategyType: Recreate
image:
repository: jesec/rtorrent-flood
pullPolicy: IfNotPresent
tag: latest
nameOverride: ""
fullnameOverride: ""
strategy:
type: Recreate
# timezone: UTC
floodSecret: "supersecret"
uid: 1001
gid: 1001
env:
# TZ:
HOME: "/config"
rtorrent:
enabled: true
image:
repository: billimek/rtorrent
tag: latest
pullPolicy: Always
resources:
requests:
cpu: "50m"
memory: "50Mi"
limits:
memory: "1Gi"
flood:
enabled: true
image:
repository: jfurrow/flood-ui
tag: latest
pullPolicy: Always
resources:
requests:
memory: "100Mi"
cpu: "10m"
limits:
memory: "250Mi"
guiService:
type: ClusterIP
port: 3000
## 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: 49161
## 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
args:
- "--port 3000"
- "--allowedpath /downloads"
service:
port:
port: 3000
additionalServices:
- enabled: true
nameSuffix: bittorrent
type: ClusterIP
port:
port: 6881
name: bittorrent
protocol: TCP
targetPort: 6881
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
persistence:
config:
enabled: true
## configuration data Persistent Volume Storage Class
enabled: false
emptyDir:
enabled: false
downloads:
enabled: false
emptyDir:
enabled: false
## 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: "-"
##
## 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
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
skipuninstall: false
data:
enabled: true
## torrents data 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
## Do not delete the pvc upon helm uninstall
skipuninstall: false
# skipuninstall: false
# existingClaim: ""
nodeSelector: {}
# -- Minimal configuration provided from https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc
# @default -- see URL to default config
config: |
#############################################################################
# A minimal rTorrent configuration that provides the basic features
#############################################################################
tolerations: []
# Some default configs are commented out by #, you can override them to fit your needs
# Lines commented out by ## are merely examples (NOT default)
affinity: {}
# It is recommended to extend upon this default config file. For example:
# override only some configs via command line: -o network.port_range.set=6881-6881
# or, on top of custom config: import = /etc/rtorrent/rtorrent.rc
podAnnotations: {}
# rTorrent runtime directory (cfg.basedir) [default: "$HOME/.local/share/rtorrent"]
method.insert = cfg.basedir, private|const|string, (cat,(fs.homedir),"/.local/share/rtorrent/")
# Default download directory (cfg.download) [default: "$(cfg.basedir)/download"]
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
# Log directory (cfg.logs) [default: "$(cfg.basedir)/log"]
method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log")
# Torrent session directory (cfg.session) [default: "$(cfg.basedir)/.session"]
method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),".session/")
# Watch (drop to add) directories (cfg.watch) [default: "$(cfg.basedir)/watch"]
method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/")
# Create directories
fs.mkdir.recursive = (cat,(cfg.basedir))
fs.mkdir = (cat,(cfg.download))
fs.mkdir = (cat,(cfg.logs))
fs.mkdir = (cat,(cfg.session))
fs.mkdir = (cat,(cfg.watch))
fs.mkdir = (cat,(cfg.watch),"/load")
fs.mkdir = (cat,(cfg.watch),"/start")
# Drop to "$(cfg.watch)/load" to add torrent
schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent")))
# Drop to "$(cfg.watch)/start" to add torrent and start downloading
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent")))
# Listening port for incoming peer traffic
#network.port_range.set = 6881-6999
#network.port_random.set = yes
# Distributed Hash Table and Peer EXchange
# Enable tracker-less torrents but vulnerable to passive sniffing
# DHT and PEX are always disabled for private torrents
#dht.mode.set = auto
#dht.port.set = 6881
#protocol.pex.set = yes
# DHT nodes for bootstrapping
dht.add_bootstrap = dht.transmissionbt.com:6881
dht.add_bootstrap = dht.libtorrent.org:25401
# UDP tracker support
#trackers.use_udp.set = yes
# Peer settings
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 250
throttle.min_peers.normal.set = 20
throttle.max_peers.normal.set = 60
throttle.min_peers.seed.set = 30
throttle.max_peers.seed.set = 80
trackers.numwant.set = 80
#protocol.encryption.set = allow_incoming,try_outgoing,enable_retry
# Limits for file handle resources, this is optimized for
# an `ulimit` of 1024 (a common default). You MUST leave
# a ceiling of handles reserved for rTorrent's internal needs!
network.max_open_files.set = 600
network.max_open_sockets.set = 300
# Memory resource usage (increase if you have a large number of items loaded,
# and/or the available resources to spend)
pieces.memory.max.set = 1800M
#network.xmlrpc.size_limit.set = 16M
# Basic operational settings
session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download))
log.execute = (cat, (cfg.logs), "execute.log")
##log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log")
# Other operational settings
encoding.add = utf8
system.umask.set = 0027
system.cwd.set = (directory.default)
#schedule2 = low_diskspace, 5, 60, ((close_low_diskspace, 500M))
#pieces.hash.on_completion.set = no
##view.sort_current = seeding, greater=d.ratio=
##keys.layout.set = qwerty
# HTTP and SSL
network.http.max_open.set = 50
network.http.dns_cache_timeout.set = 25
# Path to the CA bundle. By default, rTorrent tries to detect from:
# $RTORRENT_CA_BUNDLE (highest priority)
# $CURL_CA_BUNDLE
# $SSL_CERT_FILE
# /etc/ssl/certs/ca-certificates.crt
# /etc/pki/tls/certs/ca-bundle.crt
# /usr/share/ssl/certs/ca-bundle.crt
# /usr/local/share/certs/ca-root-nss.crt
# /etc/ssl/cert.pem (lowest priority)
##network.http.cacert.set = /etc/ssl/certs/ca-certificates.crt
# Path to the certificate directory to verify the peer. The certificates
# must be in PEM format, and the directory must have been processed using
# the c_rehash utility supplied with openssl.
#
# For advanced users only, generally you should use network.http.cacert.set
# to specify path to the bundle of certificates.
##network.http.capath.set = "/etc/ssl/certs"
#network.http.ssl_verify_peer.set = 1
#network.http.ssl_verify_host.set = 1
# Run the rTorrent process as a daemon in the background
#system.daemon.set = false
# XML-RPC interface
network.scgi.open_local = (cat,(cfg.basedir),rtorrent.sock)
# Logging:
# Levels = critical error warn notice info debug
# Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
print = (cat, "Logging to ", (cfg.logfile))
log.open_file = "log", (cfg.logfile)
log.add_output = "info", "log"
##log.add_output = "tracker_debug", "log"
### END of rtorrent.rc ###