From 6a388c870b8fe7bf6c3a8c19e2a642270b3c5d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= Date: Tue, 22 Jun 2021 16:20:59 +0200 Subject: [PATCH] [rtorrent-flood] Migrate to common v3 (#1050) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs --- charts/stable/rtorrent-flood/Chart.yaml | 4 +- charts/stable/rtorrent-flood/README.md | 53 ++++++------- .../rtorrent-flood/README_CHANGELOG.md.gotmpl | 13 +++- .../stable/rtorrent-flood/ci/ct-values.yaml | 6 +- .../rtorrent-flood/templates/common.yaml | 36 +++------ .../rtorrent-flood/templates/configmap.yaml | 4 +- charts/stable/rtorrent-flood/values.yaml | 74 +++++++++---------- 7 files changed, 93 insertions(+), 97 deletions(-) diff --git a/charts/stable/rtorrent-flood/Chart.yaml b/charts/stable/rtorrent-flood/Chart.yaml index 1f5ec363..b8a27d7f 100644 --- a/charts/stable/rtorrent-flood/Chart.yaml +++ b/charts/stable/rtorrent-flood/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: latest description: rTorrent is a stable, high-performance and low resource consumption BitTorrent client. name: rtorrent-flood -version: 7.3.0 +version: 8.0.0 kubeVersion: ">=1.16.0-0" keywords: - rtorrent @@ -21,4 +21,4 @@ maintainers: dependencies: - name: common repository: https://library-charts.k8s-at-home.com - version: 2.5.0 + version: 3.2.0 diff --git a/charts/stable/rtorrent-flood/README.md b/charts/stable/rtorrent-flood/README.md index 59509bf1..b4dab2dc 100644 --- a/charts/stable/rtorrent-flood/README.md +++ b/charts/stable/rtorrent-flood/README.md @@ -1,6 +1,6 @@ # rtorrent-flood -![Version: 7.3.0](https://img.shields.io/badge/Version-7.3.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 8.0.0](https://img.shields.io/badge/Version-8.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) rTorrent is a stable, high-performance and low resource consumption BitTorrent client. @@ -21,7 +21,7 @@ Kubernetes: `>=1.16.0-0` | Repository | Name | Version | |------------|------|---------| -| https://library-charts.k8s-at-home.com | common | 2.5.0 | +| https://library-charts.k8s-at-home.com | common | 3.2.0 | ## TL;DR @@ -79,28 +79,20 @@ N/A | Key | Type | Default | Description | |-----|------|---------|-------------| | config | string | string | Minimal configuration provided from https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc | -| env.FLOOD_OPTION_ALLOWEDPATH | string | `"/downloads"` | | -| env.FLOOD_OPTION_HOST | string | `"0.0.0.0"` | | -| env.FLOOD_OPTION_PORT | string | `"3000"` | | -| env.FLOOD_OPTION_RTORRENT | string | `"true"` | | -| env.HOME | string | `"/config"` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"jesec/rtorrent-flood"` | | -| image.tag | string | `"latest@sha256:5ff0125ea0e2befbc2ba2f2143e130819db645cb5ef68b44a0712b8162a16f47"` | | -| ingress.enabled | bool | `false` | | -| 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"` | | +| env | object | See below | environment variables. See [image docs](https://github.com/jesec/flood#configuration) for more details. | +| env.FLOOD_OPTION_ALLOWEDPATH | string | `"/downloads"` | Allowed path for file operations | +| env.FLOOD_OPTION_HOST | string | `"0.0.0.0"` | The host that Flood should listen for web connections on | +| env.FLOOD_OPTION_PORT | string | `"3000"` | The port that Flood should listen for web connections on | +| env.FLOOD_OPTION_RTORRENT | string | `"true"` | ADVANCED: rTorrent daemon managed by Flood | +| env.HOME | string | `"/config"` | Folder where Flood stores it's configuration | +| env.TZ | string | `"UTC"` | Set the container timezone | +| image.pullPolicy | string | `"IfNotPresent"` | image pull policy | +| image.repository | string | `"jesec/rtorrent-flood"` | image repository | +| image.tag | string | `"latest@sha256:f0c894ec459e52d85bc69685247ddbd8e8fcf3709b50bf8ee8b0df3bf69b7b49"` | image tag | +| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. | +| initContainers | list | See values.yaml | Use an initContainer tto delete the rtorrent.lock file when the pod starts this is only required if `session.use_lock.set = no` is NOT set | +| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. | +| service | object | See values.yaml | Configures service settings for the chart. | ## Changelog @@ -108,6 +100,14 @@ 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). +### [8.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.2.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored). + Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.2.0/charts/stable/common/) for the up-to-date values. +- Changed image tag to `latest@sha256:f0c894ec459e52d85bc69685247ddbd8e8fcf3709b50bf8ee8b0df3bf69b7b49`. + ### [6.0.0] #### Added @@ -136,8 +136,9 @@ 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 +[8.0.0]: #800 +[6.0.0]: #600 +[5.0.1]: #501 ## Support diff --git a/charts/stable/rtorrent-flood/README_CHANGELOG.md.gotmpl b/charts/stable/rtorrent-flood/README_CHANGELOG.md.gotmpl index 19135c58..0df7dc1a 100644 --- a/charts/stable/rtorrent-flood/README_CHANGELOG.md.gotmpl +++ b/charts/stable/rtorrent-flood/README_CHANGELOG.md.gotmpl @@ -9,6 +9,14 @@ 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). +### [8.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.2.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored). + Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.2.0/charts/stable/common/) for the up-to-date values. +- Changed image tag to `latest@sha256:f0c894ec459e52d85bc69685247ddbd8e8fcf3709b50bf8ee8b0df3bf69b7b49`. + ### [6.0.0] #### Added @@ -37,6 +45,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 +[8.0.0]: #800 +[6.0.0]: #600 +[5.0.1]: #501 {{- end -}} diff --git a/charts/stable/rtorrent-flood/ci/ct-values.yaml b/charts/stable/rtorrent-flood/ci/ct-values.yaml index 129c535f..311b103f 100644 --- a/charts/stable/rtorrent-flood/ci/ct-values.yaml +++ b/charts/stable/rtorrent-flood/ci/ct-values.yaml @@ -1,9 +1,7 @@ persistence: config: enabled: true - emptyDir: - enabled: true + type: emptyDir downloads: enabled: true - emptyDir: - enabled: true + type: emptyDir diff --git a/charts/stable/rtorrent-flood/templates/common.yaml b/charts/stable/rtorrent-flood/templates/common.yaml index 99a00ade..1885f62e 100644 --- a/charts/stable/rtorrent-flood/templates/common.yaml +++ b/charts/stable/rtorrent-flood/templates/common.yaml @@ -1,31 +1,19 @@ {{/* 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) -}} +{{/* Append the hardcoded settings */}} +{{- define "rtorrent-flood.harcodedValues" -}} +persistence: + rtorrent-flood-config: + enabled: true + mountPath: "/config/.rtorrent.rc" + subPath: ".rtorrent.rc" + type: "custom" + volumeSpec: + configMap: + name: {{ include "common.names.fullname" . }}-config {{- end -}} +{{- $_ := mergeOverwrite .Values (include "rtorrent-flood.harcodedValues" . | fromYaml) -}} {{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/rtorrent-flood/templates/configmap.yaml b/charts/stable/rtorrent-flood/templates/configmap.yaml index 9230037b..ec434ed5 100644 --- a/charts/stable/rtorrent-flood/templates/configmap.yaml +++ b/charts/stable/rtorrent-flood/templates/configmap.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "common.names.fullname" . }}-config + name: {{ include "common.names.fullname" . }}-config labels: {{- include "common.labels" . | nindent 4 }} data: .rtorrent.rc: | -{{ .Values.config | indent 4 }} + {{- .Values.config | nindent 4 }} diff --git a/charts/stable/rtorrent-flood/values.yaml b/charts/stable/rtorrent-flood/values.yaml index 3e1d8b44..774545a5 100644 --- a/charts/stable/rtorrent-flood/values.yaml +++ b/charts/stable/rtorrent-flood/values.yaml @@ -5,9 +5,10 @@ # https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml # -# # Use an initContainer to delete the rtorrent.lock file when the pod starts -# # this is only required if `session.use_lock.set = no` is NOT set -# initContainers: +# -- Use an initContainer tto delete the rtorrent.lock file when the pod starts +# this is only required if `session.use_lock.set = no` is NOT set +# @default -- See values.yaml +initContainers: [] # - name: remove-session-lock # image: busybox # command: ["sh", "-c", "rm -rf /config/.local/share/rtorrent/.session/rtorrent.lock"] @@ -16,61 +17,60 @@ # mountPath: /config image: + # -- image repository repository: jesec/rtorrent-flood + # -- image tag + tag: latest@sha256:f0c894ec459e52d85bc69685247ddbd8e8fcf3709b50bf8ee8b0df3bf69b7b49 + # -- image pull policy pullPolicy: IfNotPresent - tag: latest@sha256:5ff0125ea0e2befbc2ba2f2143e130819db645cb5ef68b44a0712b8162a16f47 -strategy: - type: Recreate - -# Environment configuration - for more options see: -# https://github.com/jesec/flood#configuration +# -- environment variables. See [image docs](https://github.com/jesec/flood#configuration) for more details. +# @default -- See below env: - # TZ: + # -- Set the container timezone + TZ: UTC + # -- Folder where Flood stores it's configuration HOME: "/config" + # -- The host that Flood should listen for web connections on FLOOD_OPTION_HOST: "0.0.0.0" + # -- The port that Flood should listen for web connections on FLOOD_OPTION_PORT: "3000" + # -- ADVANCED: rTorrent daemon managed by Flood FLOOD_OPTION_RTORRENT: "true" + # -- Allowed path for file operations FLOOD_OPTION_ALLOWEDPATH: "/downloads" +# -- Configures service settings for the chart. +# @default -- See values.yaml service: - port: - port: 3000 - additionalServices: - - enabled: true - nameSuffix: bittorrent + main: + ports: + http: + port: 3000 + bittorrent: + enabled: false type: ClusterIP - port: - port: 6881 - name: bittorrent - protocol: TCP - targetPort: 6881 + ports: + bittorrent: + enabled: true + port: 6881 + protocol: TCP + targetPort: 6881 ingress: - enabled: false + # -- Enable and configure ingress settings for the chart under this key. + # @default -- See values.yaml + main: + enabled: false +# -- Configure persistence settings for the chart under this key. +# @default -- See values.yaml persistence: config: enabled: false - emptyDir: - enabled: false downloads: enabled: false - emptyDir: - enabled: false - ## Persistent Volume Storage Class - ## If defined, storageClassName: - ## 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: "" # -- Minimal configuration provided from https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc # @default -- string