Skip to content
Merged
4 changes: 4 additions & 0 deletions charts/sophora-youtube-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ This version adds the "extraInitContainers" variable, that can be used to create
### 2.0.0

ExtraEnvVarsSecret replaced with envFrom.

### 2.1.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: 2.0.0
version: 2.1.0
annotations:
artifacthub.io/changes: |
- kind: changed
description: "extraEnvVarsSecret replaced with envFrom"
- 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.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,7 @@ sophora:
env:
- name: MY_SAMPLE_ENV_VAR
value: "hello, I'm an env variable"

serviceMonitor:
enabled: true
path: /prometheus
35 changes: 35 additions & 0 deletions charts/sophora-youtube-connector/tests/servicemonitor_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
- equal:
path: spec.endpoints
Comment thread
DanielRaapDev marked this conversation as resolved.
Resolved
value:
- interval: "12s"
port: http-service
path: /custom/path
- equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: enabled-test-release
app.kubernetes.io/name: sophora-youtube-connector
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