diff --git a/charts/stable/qbittorrent/Chart.yaml b/charts/stable/qbittorrent/Chart.yaml index 18ca1164..6311c572 100644 --- a/charts/stable/qbittorrent/Chart.yaml +++ b/charts/stable/qbittorrent/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: v4.3.5 +appVersion: v4.3.7 description: qBittorrent is a cross-platform free and open-source BitTorrent client name: qbittorrent -version: 12.0.0 +version: 12.1.0 kubeVersion: ">=1.16.0-0" keywords: - qbittorrent diff --git a/charts/stable/qbittorrent/README.md b/charts/stable/qbittorrent/README.md index 5f85a2b8..a4416ed3 100644 --- a/charts/stable/qbittorrent/README.md +++ b/charts/stable/qbittorrent/README.md @@ -1,6 +1,6 @@ # qbittorrent -![Version: 12.0.0](https://img.shields.io/badge/Version-12.0.0-informational?style=flat-square) ![AppVersion: v4.3.5](https://img.shields.io/badge/AppVersion-v4.3.5-informational?style=flat-square) +![Version: 12.1.0](https://img.shields.io/badge/Version-12.1.0-informational?style=flat-square) ![AppVersion: v4.3.7](https://img.shields.io/badge/AppVersion-v4.3.7-informational?style=flat-square) qBittorrent is a cross-platform free and open-source BitTorrent client @@ -78,9 +78,20 @@ N/A |-----|------|---------|-------------| | 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 | +| exporter.enabled | bool | See values.yaml | Enable and configure prometheus-qbittorrent-exporter sidecar and Prometheus podMonitor. | +| exporter.env.log | string | `"INFO"` | log level [DEBUG|INFO|WARNING|ERROR|CRITICAL] | +| exporter.env.password | string | `"adminadmin"` | qbittorrent password update value after configuring qbittorrent | +| exporter.env.port | int | `9022` | metrics port | +| exporter.env.user | string | `"admin"` | qbittorrent username update value after configuring qbittorrent | +| exporter.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | +| exporter.image.repository | string | `"ghcr.io/k8s-at-home/prometheus-qbittorrent-exporter"` | image repository | +| exporter.image.tag | string | `"v1.2.0"` | image tag | +| exporter.podMonitor.labels | object | `{}` | | +| exporter.podMonitor.interval | string | `"15s"` | | +| exporter.podMonitor.scrapeTimeout | string | `"5s"` | | | 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 | +| image.tag | string | `"v4.3.7"` | 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. | @@ -92,6 +103,12 @@ 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). +### [12.1.0] + +#### Added + +- Added podMonitor and the ability to use [prometheus-qbittorrent-exporter](https://github.com/esanchezm/prometheus-qbittorrent-exporter) as a sidecar container. + ### [12.0.0] #### Changed @@ -119,6 +136,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial version +[12.1.0]: #1210 [12.0.0]: #1200 [11.0.0]: #1100 [10.0.0]: #1000 diff --git a/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl b/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl index 0c690f87..c6a2e166 100644 --- a/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl +++ b/charts/stable/qbittorrent/README_CHANGELOG.md.gotmpl @@ -9,6 +9,12 @@ 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). +### [12.1.0] + +#### Added + +- Added podMonitor and the ability to use [prometheus-qbittorrent-exporter](https://github.com/esanchezm/prometheus-qbittorrent-exporter) as a sidecar container. + ### [12.0.0] #### Changed @@ -36,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial version +[12.1.0]: #1210 [12.0.0]: #1200 [11.0.0]: #1100 [10.0.0]: #1000 diff --git a/charts/stable/qbittorrent/templates/common.yaml b/charts/stable/qbittorrent/templates/common.yaml index 9b7f83a9..7fee2783 100644 --- a/charts/stable/qbittorrent/templates/common.yaml +++ b/charts/stable/qbittorrent/templates/common.yaml @@ -1,19 +1,45 @@ {{/* 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) -}} +{{/* Append the hardcoded settings */}} +{{- define "qbittorrent.harcodedValues" -}} +{{ if and .Values.settings.automaticPortSetup }} +persistence: + qbittorrent-scripts: + enabled: "true" + mountPath: "/config/custom-cont-init.d" + type: "custom" + volumeSpec: + configMap: + name: {{ include "common.names.fullname" . }}-scripts + defaultMode: 511 +{{ end }} + +{{ if .Values.exporter.enabled }} +additionalContainers: + exporter: + name: exporter + image: "{{ .Values.exporter.image.repository }}:{{ .Values.exporter.image.tag }}" + imagePullPolicy: {{ .Values.exporter.image.pullPolicy }} + env: + - name: QBITTORRENT_HOST + value: "http://localhost" + - name: QBITTORRENT_PORT + value: "{{ .Values.service.main.ports.http.port }}" + - name: QBITTORRENT_USER + value: "{{ .Values.exporter.env.user }}" + - name: QBITTORRENT_PASS + value: "{{ .Values.exporter.env.password }}" + - name: EXPORTER_PORT + value: "{{ .Values.exporter.env.port }}" + - name: EXPORTER_LOG_LEVEL + value: "{{ .Values.exporter.env.log }}" + ports: + - name: metrics + containerPort: {{ .Values.exporter.env.port }} +{{ end }} {{- end -}} +{{- $_ := mergeOverwrite .Values (include "qbittorrent.harcodedValues" . | fromYaml) -}} {{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/qbittorrent/templates/podmonitor.yaml b/charts/stable/qbittorrent/templates/podmonitor.yaml new file mode 100644 index 00000000..8a1a7cde --- /dev/null +++ b/charts/stable/qbittorrent/templates/podmonitor.yaml @@ -0,0 +1,29 @@ +{{- if .Values.exporter.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ template "common.names.fullname" . }} + labels: + {{- include "common.labels" . | nindent 4 }} + {{- with .Values.exporter.podMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "common.labels.selectorLabels" . | nindent 6 }} + podMetricsEndpoints: + - port: metrics + {{- with .Values.exporter.podMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.exporter.podMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + path: /metrics + relabelings: + - sourceLabels: ['namespace', 'job'] + regex: ".+/(.*)" + targetLabel: "job" + replacement: "$1" +{{- end }} diff --git a/charts/stable/qbittorrent/values.yaml b/charts/stable/qbittorrent/values.yaml index 95c57b1d..a93c895a 100644 --- a/charts/stable/qbittorrent/values.yaml +++ b/charts/stable/qbittorrent/values.yaml @@ -9,7 +9,7 @@ image: # -- image repository repository: ghcr.io/k8s-at-home/qbittorrent # -- image tag - tag: v4.3.5 + tag: v4.3.7 # -- image pull policy pullPolicy: IfNotPresent @@ -60,3 +60,30 @@ persistence: downloads: enabled: false mountPath: /downloads + +exporter: + # -- Enable and configure prometheus-qbittorrent-exporter sidecar and Prometheus podMonitor. + # @default -- See values.yaml + enabled: false + podMonitor: + interval: 15s + scrapeTimeout: 5s + labels: {} + image: + # -- image repository + repository: ghcr.io/k8s-at-home/prometheus-qbittorrent-exporter + # -- image tag + tag: v1.2.0 + # -- image pull policy + pullPolicy: IfNotPresent + env: + # -- qbittorrent username + # update value after configuring qbittorrent + user: "admin" + # -- qbittorrent password + # update value after configuring qbittorrent + password: "adminadmin" + # -- metrics port + port: 9022 + # -- log level [DEBUG|INFO|WARNING|ERROR|CRITICAL] + log: INFO