From cbbfb32afafaf900f2277b2dfdd7604506012849 Mon Sep 17 00:00:00 2001 From: Marvin Boos Date: Mon, 28 Sep 2026 14:39:39 +0200 Subject: [PATCH 1/5] [sophora-youtube-connector] Add ServiceMonitor --- charts/sophora-youtube-connector/CHANGELOG.md | 4 ++++ charts/sophora-youtube-connector/Chart.yaml | 4 +++- .../templates/servicemonitor.yaml | 15 +++++++++++++++ charts/sophora-youtube-connector/test-values.yaml | 4 ++++ charts/sophora-youtube-connector/values.yaml | 5 +++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 charts/sophora-youtube-connector/templates/servicemonitor.yaml diff --git a/charts/sophora-youtube-connector/CHANGELOG.md b/charts/sophora-youtube-connector/CHANGELOG.md index 8614a094..cd5314e8 100644 --- a/charts/sophora-youtube-connector/CHANGELOG.md +++ b/charts/sophora-youtube-connector/CHANGELOG.md @@ -15,3 +15,7 @@ Added HTTPRoute support for Gateway API. ### 1.4.0 This version adds the "extraInitContainers" variable, that can be used to create custom init containers. + +### 1.5.0 + +This version adds the service monitor configuration. diff --git a/charts/sophora-youtube-connector/Chart.yaml b/charts/sophora-youtube-connector/Chart.yaml index 161ae5b8..d72e25fc 100644 --- a/charts/sophora-youtube-connector/Chart.yaml +++ b/charts/sophora-youtube-connector/Chart.yaml @@ -15,11 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.9.3 +version: 1.9.4 annotations: artifacthub.io/changes: | - kind: fixed description: "Removed an invalid document separator when using gcp.backendPolicy.enabled:true" + - kind: added + description: "ServiceMonitor objects for the AVTool" artifacthub.io/links: | - name: Documentation for the AV Tool diff --git a/charts/sophora-youtube-connector/templates/servicemonitor.yaml b/charts/sophora-youtube-connector/templates/servicemonitor.yaml new file mode 100644 index 00000000..7760824b --- /dev/null +++ b/charts/sophora-youtube-connector/templates/servicemonitor.yaml @@ -0,0 +1,15 @@ +{{- if .Values.serviceMonitor.enabled -}} +{{- $fullName := include "sophora-youtube-connector.fullname" . -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ $fullName }} + labels: {{- include "sophora-youtube-connector.labels" . | nindent 8 }} +spec: + selector: + matchLabels: {{- include "sophora-youtube-connector.selectorLabels" . | nindent 12 }} + endpoints: + - interval: {{ .Values.serviceMonitor.interval }} + port: http + path: {{ .Values.serviceMonitor.path }} +{{- end }} diff --git a/charts/sophora-youtube-connector/test-values.yaml b/charts/sophora-youtube-connector/test-values.yaml index f0379ff0..6f0d65b8 100644 --- a/charts/sophora-youtube-connector/test-values.yaml +++ b/charts/sophora-youtube-connector/test-values.yaml @@ -315,3 +315,7 @@ sophora: env: - name: MY_SAMPLE_ENV_VAR value: "hello, I'm an env variable" + +serviceMonitor: + enabled: true + path: /prometheus diff --git a/charts/sophora-youtube-connector/values.yaml b/charts/sophora-youtube-connector/values.yaml index 8e9100c1..08758524 100644 --- a/charts/sophora-youtube-connector/values.yaml +++ b/charts/sophora-youtube-connector/values.yaml @@ -244,3 +244,8 @@ gcp: # extraDeploy is a list of full Kubernetes manifests that will be rendered additionally by this chart extraDeploy: [] + +serviceMonitor: + enabled: false + interval: 10s + path: /prometheus From 2a709d29c3b3f8de7b0c82edd451e2693fd5c28f Mon Sep 17 00:00:00 2001 From: Marvin Boos Date: Mon, 28 Sep 2026 14:46:51 +0200 Subject: [PATCH 2/5] [sophora-youtube-connector] removed old change annotation --- charts/sophora-youtube-connector/Chart.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/sophora-youtube-connector/Chart.yaml b/charts/sophora-youtube-connector/Chart.yaml index d72e25fc..acb89528 100644 --- a/charts/sophora-youtube-connector/Chart.yaml +++ b/charts/sophora-youtube-connector/Chart.yaml @@ -18,8 +18,6 @@ type: application version: 1.9.4 annotations: artifacthub.io/changes: | - - kind: fixed - description: "Removed an invalid document separator when using gcp.backendPolicy.enabled:true" - kind: added description: "ServiceMonitor objects for the AVTool" From c4d2325fde558eb7a8b184d66ecd462b7e2b0a78 Mon Sep 17 00:00:00 2001 From: Marvin Boos Date: Mon, 28 Sep 2026 14:49:29 +0200 Subject: [PATCH 3/5] [sophora-youtube-connector] Fixed port name in service monitor config --- charts/sophora-youtube-connector/templates/servicemonitor.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sophora-youtube-connector/templates/servicemonitor.yaml b/charts/sophora-youtube-connector/templates/servicemonitor.yaml index 7760824b..7681d4b4 100644 --- a/charts/sophora-youtube-connector/templates/servicemonitor.yaml +++ b/charts/sophora-youtube-connector/templates/servicemonitor.yaml @@ -10,6 +10,6 @@ spec: matchLabels: {{- include "sophora-youtube-connector.selectorLabels" . | nindent 12 }} endpoints: - interval: {{ .Values.serviceMonitor.interval }} - port: http + port: http-service path: {{ .Values.serviceMonitor.path }} {{- end }} From a9034b39788c7be7e6d71b7b7c52aedebee1a07e Mon Sep 17 00:00:00 2001 From: Marvin Boos Date: Mon, 5 Oct 2026 18:12:16 +0200 Subject: [PATCH 4/5] [sophora-youtube-connector] Version set to 1.10.0, fixed indentation in servicemonitor.yaml, added servicemonitor test --- charts/sophora-youtube-connector/Chart.yaml | 2 +- .../templates/servicemonitor.yaml | 16 +++++----- .../tests/servicemonitor_test.yaml | 30 +++++++++++++++++++ .../tests/values/servicemonitor.yaml | 4 +++ 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 charts/sophora-youtube-connector/tests/servicemonitor_test.yaml create mode 100644 charts/sophora-youtube-connector/tests/values/servicemonitor.yaml diff --git a/charts/sophora-youtube-connector/Chart.yaml b/charts/sophora-youtube-connector/Chart.yaml index acb89528..bb84a968 100644 --- a/charts/sophora-youtube-connector/Chart.yaml +++ b/charts/sophora-youtube-connector/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.9.4 +version: 1.10.0 annotations: artifacthub.io/changes: | - kind: added diff --git a/charts/sophora-youtube-connector/templates/servicemonitor.yaml b/charts/sophora-youtube-connector/templates/servicemonitor.yaml index 7681d4b4..9c59636c 100644 --- a/charts/sophora-youtube-connector/templates/servicemonitor.yaml +++ b/charts/sophora-youtube-connector/templates/servicemonitor.yaml @@ -3,13 +3,13 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ $fullName }} - labels: {{- include "sophora-youtube-connector.labels" . | nindent 8 }} + name: {{ $fullName }} + labels: {{- include "sophora-youtube-connector.labels" . | nindent 8 }} spec: - selector: - matchLabels: {{- include "sophora-youtube-connector.selectorLabels" . | nindent 12 }} - endpoints: - - interval: {{ .Values.serviceMonitor.interval }} - port: http-service - path: {{ .Values.serviceMonitor.path }} + selector: + matchLabels: {{- include "sophora-youtube-connector.selectorLabels" . | nindent 12 }} + endpoints: + - interval: {{ .Values.serviceMonitor.interval }} + port: http-service + path: {{ .Values.serviceMonitor.path }} {{- end }} diff --git a/charts/sophora-youtube-connector/tests/servicemonitor_test.yaml b/charts/sophora-youtube-connector/tests/servicemonitor_test.yaml new file mode 100644 index 00000000..71f7bc03 --- /dev/null +++ b/charts/sophora-youtube-connector/tests/servicemonitor_test.yaml @@ -0,0 +1,30 @@ +suite: test servicemonitor +templates: + - servicemonitor.yaml +chart: + version: 0.9.8 + appVersion: 1.2.3 +tests: + - it: should not create servicemonitor by default + asserts: + - hasDocuments: + count: 0 + + - it: should create servicemonitor with custom configuration + release: + name: enabled-test-release + values: + - ./values/servicemonitor.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: ServiceMonitor + - isAPIVersion: + of: monitoring.coreos.com/v1 + - contains: + path: spec.endpoints + content: + interval: "12s" + port: http-service + path: /custom/path diff --git a/charts/sophora-youtube-connector/tests/values/servicemonitor.yaml b/charts/sophora-youtube-connector/tests/values/servicemonitor.yaml new file mode 100644 index 00000000..8a1972ee --- /dev/null +++ b/charts/sophora-youtube-connector/tests/values/servicemonitor.yaml @@ -0,0 +1,4 @@ +serviceMonitor: + enabled: true + path: /custom/path + interval: "12s" From ecc1e871ef92ac3d6c29bb131d2c606974b97fee Mon Sep 17 00:00:00 2001 From: Marvin Boos Date: Mon, 5 Oct 2026 18:38:48 +0200 Subject: [PATCH 5/5] [sophora-youtube-connector] Fixed wrong version in CHANGELOG.md --- charts/sophora-youtube-connector/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sophora-youtube-connector/CHANGELOG.md b/charts/sophora-youtube-connector/CHANGELOG.md index cd5314e8..6288b36e 100644 --- a/charts/sophora-youtube-connector/CHANGELOG.md +++ b/charts/sophora-youtube-connector/CHANGELOG.md @@ -16,6 +16,6 @@ Added HTTPRoute support for Gateway API. This version adds the "extraInitContainers" variable, that can be used to create custom init containers. -### 1.5.0 +### 1.10.0 This version adds the service monitor configuration.