From 84135b7021e1030b5a52a2707130b5af93b6f7ed Mon Sep 17 00:00:00 2001 From: Rob Reus Date: Fri, 17 Nov 2023 15:23:05 +0100 Subject: [PATCH 1/6] Adding exportarr to expose metrics to prometheus --- charts/stable/bazarr/Chart.yaml | 2 +- charts/stable/bazarr/questions.yaml | 1 + charts/stable/bazarr/templates/common.yaml | 12 +++- charts/stable/bazarr/values.yaml | 70 +++++++++++++++++++++- 4 files changed, 82 insertions(+), 3 deletions(-) diff --git a/charts/stable/bazarr/Chart.yaml b/charts/stable/bazarr/Chart.yaml index 8495b8718c06..f9db59db1b07 100644 --- a/charts/stable/bazarr/Chart.yaml +++ b/charts/stable/bazarr/Chart.yaml @@ -25,7 +25,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/bazarr - https://github.com/morpheus65535/bazarr type: application -version: 15.0.20 +version: 15.1.1 annotations: truecharts.org/category: media truecharts.org/SCALE-support: "true" diff --git a/charts/stable/bazarr/questions.yaml b/charts/stable/bazarr/questions.yaml index 4e64dc32febc..5b23aaa4b9a6 100644 --- a/charts/stable/bazarr/questions.yaml +++ b/charts/stable/bazarr/questions.yaml @@ -82,6 +82,7 @@ questions: default: 568 # Include{resources} +# Include{metrics} # Include{advanced} # Include{addons} # Include{codeserver} diff --git a/charts/stable/bazarr/templates/common.yaml b/charts/stable/bazarr/templates/common.yaml index b51394e00a4d..3c93f5786113 100644 --- a/charts/stable/bazarr/templates/common.yaml +++ b/charts/stable/bazarr/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/bazarr/values.yaml b/charts/stable/bazarr/values.yaml index 117ac689b720..e45ca93cd653 100644 --- a/charts/stable/bazarr/values.yaml +++ b/charts/stable/bazarr/values.yaml @@ -2,6 +2,11 @@ image: repository: ghcr.io/onedr0p/bazarr pullPolicy: IfNotPresent tag: 1.3.1@sha256:840242bb1dfb337e5bfa579af039738bbf9948f6f33deecf451ebdd9ca509e31 +exportarrImage: + repository: tccr.io/truecharts/exportarr + pullPolicy: IfNotPresent + tag: v1.6.0@sha256:ee118701a2ebe8ccb5c25e1003fbed9ef7ce217d4e4b8b6df30cc2a0def818f8 + service: main: ports: @@ -9,10 +14,73 @@ service: port: 6767 protocol: http targetPort: 6767 + metrics: + enabled: true + type: ClusterIP + targetSelector: exportarr + ports: + metrics: + enabled: true + port: 7879 + targetSelector: exportarr + +workload: + exportarr: + enabled: true + type: Deployment + strategy: RollingUpdate + replicas: 1 + podSpec: + containers: + exportarr: + primary: true + enabled: true + imageSelector: exportarrImage + args: + - bazarr + probes: + liveness: + enabled: true + type: http + path: /healthz + port: "{{ .Values.service.metrics.ports.metrics.port }}" + readiness: + enabled: true + type: http + path: /healthz + port: "{{ .Values.service.metrics.ports.metrics.port }}" + startup: + enabled: true + type: http + path: /healthz + port: "{{ .Values.service.metrics.ports.metrics.port }}" + env: + INTERFACE: 0.0.0.0 + PORT: "{{ .Values.service.metrics.ports.metrics.port }}" + URL: '{{ printf "http://%v:%v" (include "tc.v1.common.lib.chart.names.fullname" $) .Values.service.main.ports.main.port }}' + CONFIG: "/config/config.xml" + persistence: config: enabled: true - mountPath: /config + targetSelector: + main: + main: + mountPath: /config + exportarr: + exportarr: + mountPath: /config + readOnly: true + +metrics: + main: + enabled: true + type: "servicemonitor" + endpoints: + - port: metrics + path: /metrics + targetSelector: metrics + portal: open: enabled: true From da4b28a77a070ddbdb04ad45a12387526a3e7432 Mon Sep 17 00:00:00 2001 From: Rob Reus Date: Mon, 20 Nov 2023 12:31:58 +0100 Subject: [PATCH 2/6] Adding question for bazarr api key --- charts/stable/bazarr/questions.yaml | 8 ++++++++ charts/stable/bazarr/templates/common.yaml | 2 ++ charts/stable/bazarr/values.yaml | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/stable/bazarr/questions.yaml b/charts/stable/bazarr/questions.yaml index 5b23aaa4b9a6..fc341a7b20e1 100644 --- a/charts/stable/bazarr/questions.yaml +++ b/charts/stable/bazarr/questions.yaml @@ -83,6 +83,14 @@ questions: # Include{resources} # Include{metrics} + - variable: apiKey + label: "Bazarr API key" + description: "Can be found in the Bazarr settings" + schema: + type: string + default: "" + required: true +# Include{prometheusRule} # Include{advanced} # Include{addons} # Include{codeserver} diff --git a/charts/stable/bazarr/templates/common.yaml b/charts/stable/bazarr/templates/common.yaml index 3c93f5786113..cc28d77cbf73 100644 --- a/charts/stable/bazarr/templates/common.yaml +++ b/charts/stable/bazarr/templates/common.yaml @@ -5,6 +5,8 @@ {{- if not .Values.metrics.main.enabled -}} {{- $_ := set .Values.workload.exportarr "enabled" false -}} {{- $_ := set .Values.service.metrics "enabled" false -}} +{{- else -}} + {{- $_ := set .Values.workload.exportarr.podSpec.containers.exportarr.env "APIKEY" .Values.metrics.main.apiKey -}} {{- end -}} {{/* Render the templates */}} diff --git a/charts/stable/bazarr/values.yaml b/charts/stable/bazarr/values.yaml index e45ca93cd653..3e92f28f3c3b 100644 --- a/charts/stable/bazarr/values.yaml +++ b/charts/stable/bazarr/values.yaml @@ -58,7 +58,7 @@ workload: INTERFACE: 0.0.0.0 PORT: "{{ .Values.service.metrics.ports.metrics.port }}" URL: '{{ printf "http://%v:%v" (include "tc.v1.common.lib.chart.names.fullname" $) .Values.service.main.ports.main.port }}' - CONFIG: "/config/config.xml" + APIKEY: "" persistence: config: @@ -80,6 +80,7 @@ metrics: - port: metrics path: /metrics targetSelector: metrics + apiKey: "" portal: open: From de5156e2de084274c35b6ebdfa4b8d8c122baeb2 Mon Sep 17 00:00:00 2001 From: Rob Reus Date: Mon, 20 Nov 2023 12:45:53 +0100 Subject: [PATCH 3/6] Adding default-values.yaml for ci testing --- charts/stable/bazarr/ci/default-values.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 charts/stable/bazarr/ci/default-values.yaml diff --git a/charts/stable/bazarr/ci/default-values.yaml b/charts/stable/bazarr/ci/default-values.yaml new file mode 100644 index 000000000000..8c71aec7cea7 --- /dev/null +++ b/charts/stable/bazarr/ci/default-values.yaml @@ -0,0 +1,3 @@ +metrics: + main: + apiKey: newsn7zz12j67l4cwovjt6cyq6raqzmz From 1f2b6e362ca6feb0f9d4d780cd3391001f803a11 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Wed, 20 Dec 2023 12:58:05 +0100 Subject: [PATCH 4/6] Update charts/stable/bazarr/templates/common.yaml Signed-off-by: Kjeld Schouten --- charts/stable/bazarr/templates/common.yaml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/charts/stable/bazarr/templates/common.yaml b/charts/stable/bazarr/templates/common.yaml index cc28d77cbf73..b51394e00a4d 100644 --- a/charts/stable/bazarr/templates/common.yaml +++ b/charts/stable/bazarr/templates/common.yaml @@ -1,13 +1 @@ -{{/* 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 -}} -{{- else -}} - {{- $_ := set .Values.workload.exportarr.podSpec.containers.exportarr.env "APIKEY" .Values.metrics.main.apiKey -}} -{{- end -}} - -{{/* Render the templates */}} -{{- include "tc.v1.common.loader.apply" . -}} +{{ include "tc.v1.common.loader.all" . }} From 008323d2750fd278441787899e6d7007b5be28da Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Wed, 20 Dec 2023 12:58:12 +0100 Subject: [PATCH 5/6] Update charts/stable/bazarr/values.yaml Signed-off-by: Kjeld Schouten --- charts/stable/bazarr/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/stable/bazarr/values.yaml b/charts/stable/bazarr/values.yaml index 3e92f28f3c3b..a4143cada5bf 100644 --- a/charts/stable/bazarr/values.yaml +++ b/charts/stable/bazarr/values.yaml @@ -58,7 +58,7 @@ workload: INTERFACE: 0.0.0.0 PORT: "{{ .Values.service.metrics.ports.metrics.port }}" URL: '{{ printf "http://%v:%v" (include "tc.v1.common.lib.chart.names.fullname" $) .Values.service.main.ports.main.port }}' - APIKEY: "" + APIKEY: "{{ .Values.metrics.main.apiKey }}" persistence: config: From b9f2ccf06ff7c910beb1946f68224e31e292ac7f Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Wed, 20 Dec 2023 12:58:18 +0100 Subject: [PATCH 6/6] Update charts/stable/bazarr/values.yaml Signed-off-by: Kjeld Schouten --- charts/stable/bazarr/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/stable/bazarr/values.yaml b/charts/stable/bazarr/values.yaml index a4143cada5bf..66b28af3130b 100644 --- a/charts/stable/bazarr/values.yaml +++ b/charts/stable/bazarr/values.yaml @@ -26,7 +26,7 @@ service: workload: exportarr: - enabled: true + enabled: "{{ .Values.metrics.main.enabled }}" type: Deployment strategy: RollingUpdate replicas: 1