From a59b2b433bf1b43f1dd36e8424034965ff61d5da Mon Sep 17 00:00:00 2001 From: Ac1dburn Date: Wed, 14 Feb 2024 12:03:46 -0500 Subject: [PATCH] chore(deps): Adding exporter for rutorrent (#17768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Ac1dburn Signed-off-by: Ac1dburn Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: Kjeld Schouten --- charts/stable/rtorrent-rutorrent/Chart.yaml | 2 +- .../stable/rtorrent-rutorrent/questions.yaml | 2 + .../rtorrent-rutorrent/templates/common.yaml | 12 ++++- charts/stable/rtorrent-rutorrent/values.yaml | 52 +++++++++++++++++++ 4 files changed, 66 insertions(+), 2 deletions(-) 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: