From 25c3695e0f89e2df3561e6cd420f9147ed68851b 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: Fri, 11 Jun 2021 19:33:15 +0200 Subject: [PATCH] [qbittorrent] Migrate to common v3 (#978) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs --- charts/stable/qbittorrent/Chart.yaml | 6 +- charts/stable/qbittorrent/README.md | 48 ++++------ .../qbittorrent/README_CHANGELOG.md.gotmpl | 9 ++ .../stable/qbittorrent/templates/common.yaml | 18 ++++ .../qbittorrent/templates/configmap.yaml | 11 +-- charts/stable/qbittorrent/values.yaml | 91 +++++++------------ 6 files changed, 86 insertions(+), 97 deletions(-) diff --git a/charts/stable/qbittorrent/Chart.yaml b/charts/stable/qbittorrent/Chart.yaml index 36b0b725..cbf16eb0 100644 --- a/charts/stable/qbittorrent/Chart.yaml +++ b/charts/stable/qbittorrent/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: v4.3.4.1 +appVersion: v4.3.5 description: qBittorrent is a cross-platform free and open-source BitTorrent client name: qbittorrent -version: 10.1.0 +version: 11.0.0 kubeVersion: ">=1.16.0-0" keywords: - qbittorrent @@ -18,4 +18,4 @@ maintainers: dependencies: - name: common repository: https://library-charts.k8s-at-home.com - version: 2.5.0 + version: 3.0.2 diff --git a/charts/stable/qbittorrent/README.md b/charts/stable/qbittorrent/README.md index 38f0fb41..a69afcb8 100644 --- a/charts/stable/qbittorrent/README.md +++ b/charts/stable/qbittorrent/README.md @@ -1,6 +1,6 @@ # qbittorrent -![Version: 10.1.0](https://img.shields.io/badge/Version-10.1.0-informational?style=flat-square) ![AppVersion: v4.3.4.1](https://img.shields.io/badge/AppVersion-v4.3.4.1-informational?style=flat-square) +![Version: 11.0.0](https://img.shields.io/badge/Version-11.0.0-informational?style=flat-square) ![AppVersion: v4.3.5](https://img.shields.io/badge/AppVersion-v4.3.5-informational?style=flat-square) qBittorrent is a cross-platform free and open-source BitTorrent client @@ -19,7 +19,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.0.2 | ## TL;DR @@ -76,32 +76,15 @@ N/A | Key | Type | Default | Description | |-----|------|---------|-------------| -| additionalVolumeMounts[0].mountPath | string | `"/config/custom-cont-init.d"` | | -| additionalVolumeMounts[0].name | string | `"qbittorrent-scripts"` | | -| additionalVolumes[0].emptyDir | object | `{}` | | -| additionalVolumes[0].name | string | `"qbittorrent-scripts"` | | -| env | object | `{}` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"ghcr.io/k8s-at-home/qbittorrent"` | | -| image.tag | string | `"v4.3.4.1"` | | -| 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` | | -| persistence.downloads.mountPath | string | `"/downloads"` | | -| persistence.media.emptyDir.enabled | bool | `false` | | -| persistence.media.enabled | bool | `false` | | -| persistence.media.mountPath | string | `"/media"` | | -| 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 | `8080` | | -| strategy.type | string | `"Recreate"` | | +| env | object | See below | environment variables. See [image docs](https://docs.k8s-at-home.com/our-container-images/configuration/) for more details. | +| env.TZ | string | `"UTC"` | Set the container timezone | +| image.pullPolicy | string | `"IfNotPresent"` | image pull policy | +| image.repository | string | `"ghcr.io/k8s-at-home/qbittorrent"` | image repository | +| image.tag | string | `"v4.3.5"` | image tag | +| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. | +| 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. | +| settings.automaticPortSetup | bool | `false` | Enables automatic port configuration at startup This sets the qbittorrent port to the value of `service.bittorrent.ports.bittorrent.port`. | ## Changelog @@ -109,6 +92,15 @@ 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). +### [11.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.0.2. 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.0.2/charts/stable/common/) for the up-to-date values. +- Changed image tag to `v4.3.5`. +- Move automatic port management at startup to `settings.automaticPortSetup`. + ### [10.0.0] #### Changed diff --git a/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl b/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl index 2274e928..13009710 100644 --- a/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl +++ b/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl @@ -9,6 +9,15 @@ 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). +### [11.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.0.2. 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.0.2/charts/stable/common/) for the up-to-date values. +- Changed image tag to `v4.3.5`. +- Move automatic port management at startup to `settings.automaticPortSetup`. + ### [10.0.0] #### Changed diff --git a/charts/stable/qbittorrent/templates/common.yaml b/charts/stable/qbittorrent/templates/common.yaml index a6613c2c..9b7f83a9 100644 --- a/charts/stable/qbittorrent/templates/common.yaml +++ b/charts/stable/qbittorrent/templates/common.yaml @@ -1 +1,19 @@ +{{/* Make sure all variables are set properly */}} +{{- include "common.values.setup" . }} + +{{/* Append the configMap volume to the volumes */}} +{{- define "qbittorrent.configmapVolume" -}} +enabled: "true" +mountPath: "/config/custom-cont-init.d" +type: "custom" +volumeSpec: + configMap: + name: {{ include "common.names.fullname" . }}-scripts + defaultMode: 511 +{{- end -}} +{{- if and .Values.settings.automaticPortSetup -}} + {{- $_ := set .Values.persistence "qbittorrent-scripts" (include "qbittorrent.configmapVolume" . | fromYaml) -}} +{{- end -}} + +{{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/qbittorrent/templates/configmap.yaml b/charts/stable/qbittorrent/templates/configmap.yaml index 7a354849..205872b7 100644 --- a/charts/stable/qbittorrent/templates/configmap.yaml +++ b/charts/stable/qbittorrent/templates/configmap.yaml @@ -5,14 +5,9 @@ metadata: labels: {{- include "common.labels" . | nindent 4 }} data: - {{- /* Determine if the bittorrent port is set somewhere */ -}} - {{- $bittorrentPort := "" -}} - {{- range $extraServices := .Values.service.additionalServices }} - {{- if and .enabled (eq "bittorrent" .nameSuffix) -}} - {{- $bittorrentPort = .port.port -}} - {{- end }} - {{- end }} - {{- if $bittorrentPort }} + {{- /* Determine if the bittorrent port is enabled */ -}} + {{- $bittorrentPort := .Values.service.bittorrent.ports.bittorrent.port -}} + {{- if and .Values.settings.automaticPortSetup $bittorrentPort }} 31-update-port: |- #!/bin/bash QBITTORRENT_CONFIGFILE="/config/qBittorrent/qBittorrent.conf" diff --git a/charts/stable/qbittorrent/values.yaml b/charts/stable/qbittorrent/values.yaml index e1ddf2a1..95c57b1d 100644 --- a/charts/stable/qbittorrent/values.yaml +++ b/charts/stable/qbittorrent/values.yaml @@ -6,82 +6,57 @@ # image: + # -- image repository repository: ghcr.io/k8s-at-home/qbittorrent + # -- image tag + tag: v4.3.5 + # -- image pull policy pullPolicy: IfNotPresent - tag: v4.3.4.1 -strategy: - type: Recreate +settings: + # -- Enables automatic port configuration at startup + # This sets the qbittorrent port to the value of `service.bittorrent.ports.bittorrent.port`. + automaticPortSetup: false -env: {} - # TZ: UTC +# -- environment variables. See [image docs](https://docs.k8s-at-home.com/our-container-images/configuration/) for more details. +# @default -- See below +env: + # -- Set the container timezone + TZ: UTC +# -- Configures service settings for the chart. +# @default -- See values.yaml service: - port: - port: 8080 - additionalServices: - - enabled: true - nameSuffix: bittorrent + main: + ports: + http: + port: 8080 + 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 media: enabled: false - emptyDir: - enabled: false mountPath: /media - ## 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: "" downloads: enabled: false - emptyDir: - enabled: false mountPath: /downloads - ## 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: "" - -additionalVolumes: - - name: qbittorrent-scripts - emptyDir: {} - ## When you want to enable automatic port configuration at startup, adjust this to: - # configMap: - # name: -scripts - # defaultMode: 511 - -additionalVolumeMounts: - - mountPath: /config/custom-cont-init.d - name: qbittorrent-scripts