mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 07:59:02 +00:00
[qbittorrent] add podMonitor and ability to add exporter as a sidecar (#1153)
* [qbittorrent] add podMonitor and ability to add exporter as a sidecar
This commit is contained in:
parent
62140f8d2c
commit
1aa5bf3cbb
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
{{/* 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 -}}
|
||||
{{- if and .Values.settings.automaticPortSetup -}}
|
||||
{{- $_ := set .Values.persistence "qbittorrent-scripts" (include "qbittorrent.configmapVolume" . | fromYaml) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := mergeOverwrite .Values (include "qbittorrent.harcodedValues" . | fromYaml) -}}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "common.all" . }}
|
||||
|
29
charts/stable/qbittorrent/templates/podmonitor.yaml
Normal file
29
charts/stable/qbittorrent/templates/podmonitor.yaml
Normal file
@ -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 }}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user