Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/sophora-youtube-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.0

This version adds the service monitor configuration.
6 changes: 3 additions & 3 deletions charts/sophora-youtube-connector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ 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.10.0
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
Expand Down
15 changes: 15 additions & 0 deletions charts/sophora-youtube-connector/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -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-service
path: {{ .Values.serviceMonitor.path }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/sophora-youtube-connector/test-values.yaml
Comment thread
boossubshell marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,7 @@ sophora:
env:
- name: MY_SAMPLE_ENV_VAR
value: "hello, I'm an env variable"

serviceMonitor:
enabled: true
path: /prometheus
30 changes: 30 additions & 0 deletions charts/sophora-youtube-connector/tests/servicemonitor_test.yaml
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich würde gerne die ganze spec testen, also auch die selector.matchLabels. Aber wenn du keine Zeit dafür hast, ist es so schon gut 👍

content:
Comment on lines +25 to +27

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- contains:
path: spec.endpoints
content:
- equal:
path: spec.endpoints
value:

interval: "12s"
port: http-service
path: /custom/path
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
serviceMonitor:
enabled: true
path: /custom/path
interval: "12s"
5 changes: 5 additions & 0 deletions charts/sophora-youtube-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading