diff --git a/charts/stable/rtorrent-rutorrent/Chart.yaml b/charts/stable/rtorrent-rutorrent/Chart.yaml index 998080e15a2..46a5da362b3 100644 --- a/charts/stable/rtorrent-rutorrent/Chart.yaml +++ b/charts/stable/rtorrent-rutorrent/Chart.yaml @@ -35,4 +35,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/rtorrent-rutorrent - https://ghcr.io/crazy-max/rtorrent-rutorrent type: application -version: 3.1.11 +version: 3.1.13 \ No newline at end of file diff --git a/charts/stable/rtorrent-rutorrent/questions.yaml b/charts/stable/rtorrent-rutorrent/questions.yaml index c2fcdd9a7a1..c63c7ce598a 100644 --- a/charts/stable/rtorrent-rutorrent/questions.yaml +++ b/charts/stable/rtorrent-rutorrent/questions.yaml @@ -208,6 +208,8 @@ questions: type: int default: 568 # Include{resources} +# Include{metrics} +# Include{prometheusRule} # Include{advanced} # Include{addons} # Include{codeserver} diff --git a/charts/stable/rtorrent-rutorrent/templates/common.yaml b/charts/stable/rtorrent-rutorrent/templates/common.yaml index b51394e00a4..3c93f578611 100644 --- a/charts/stable/rtorrent-rutorrent/templates/common.yaml +++ b/charts/stable/rtorrent-rutorrent/templates/common.yaml @@ -1 +1,11 @@ -{{ include "tc.v1.common.loader.all" . }} +{{/* Make sure all variables are set properly */}} +{{- include "tc.v1.common.loader.init" . -}} + +{{/* Disable [exportarr] if requested */}} +{{- if not .Values.metrics.main.enabled -}} + {{- $_ := set .Values.workload.exportarr "enabled" false -}} + {{- $_ := set .Values.service.metrics "enabled" false -}} +{{- end -}} + +{{/* Render the templates */}} +{{- include "tc.v1.common.loader.apply" . -}} diff --git a/charts/stable/rtorrent-rutorrent/values.yaml b/charts/stable/rtorrent-rutorrent/values.yaml index b53e2fd3d91..edb58fcc252 100644 --- a/charts/stable/rtorrent-rutorrent/values.yaml +++ b/charts/stable/rtorrent-rutorrent/values.yaml @@ -3,6 +3,11 @@ image: pullPolicy: IfNotPresent tag: 4.2.9-0.9.8_2-0.13.8_1@sha256:8d089b00282a203886361268d9210106956302c2194e75ae56982a6f0398aef9 +exportarrImage: + repository: ghcr.io/thde/rtorrent_exporter + pullPolicy: IfNotPresent + tag: v1.3.1@sha256:0a7716d8b434f8ecf9370053c46e099cfde3c98a60555d3128e07e6da7438fcd + securityContext: container: PUID: 33 @@ -51,6 +56,15 @@ service: rtinc: enabled: true port: 50000 + metrics: + enabled: true + type: ClusterIP + targetSelector: exportarr + ports: + metrics: + enabled: true + port: 9135 + targetSelector: exportarr workload: main: @@ -78,6 +92,33 @@ workload: WEBDAV_PORT: "{{ .Values.service.webdav.ports.webdav.port }}" RT_INC_PORT: "{{ .Values.service.rtinc.ports.rtinc.port }}" + exportarr: + enabled: true + type: Deployment + strategy: RollingUpdate + replicas: 1 + podSpec: + containers: + exportarr: + primary: true + enabled: true + imageSelector: exportarrImage + args: + - --rtorrent.scrape-uri={{ printf "http://%s-xmlrpc.%s:%v/RPC2/" .Release.Name .Release.Namespace .Values.service.xmlrpc.ports.xmlrpc.port }} + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + env: + INTERFACE: 0.0.0.0 + PORT: "{{ .Values.service.metrics.ports.metrics.port }}" + URL: '{{ printf "http://%s-xmlrpc.%s:%v/RPC2/" .Release.Name .Release.Namespace .Values.service.xmlrpc.ports.xmlrpc.port }}' + ENABLE_ADDITIONAL_METRICS: false + ENABLE_UNKNOWN_QUEUE_ITEMS: false + persistence: data: enabled: true @@ -88,6 +129,17 @@ persistence: passwd: enabled: true mountPath: "/passwd" + +metrics: + main: + enabled: true + type: "servicemonitor" + endpoints: + - port: metrics + path: /metrics + targetSelector: metrics + prometheusRule: + enabled: false portal: open: