From 46c148edbd4182e1ac91d3853209f09c3740c523 Mon Sep 17 00:00:00 2001 From: Julen Dixneuf <1516762+dixneuf19@users.noreply.github.com> Date: Wed, 14 Apr 2021 23:09:39 +0200 Subject: [PATCH] feat(speedtest-prometheus): add namespace selection for serviceMonitor (#787) Signed-off-by: Julen Dixneuf Co-authored-by: Jeff Billimek --- charts/stable/speedtest-prometheus/Chart.yaml | 2 +- charts/stable/speedtest-prometheus/README.md | 8 +++++++- .../speedtest-prometheus/README_CHANGELOG.md.gotmpl | 6 ++++++ .../speedtest-prometheus/templates/servicemonitor.yaml | 6 ++++++ charts/stable/speedtest-prometheus/values.yaml | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/charts/stable/speedtest-prometheus/Chart.yaml b/charts/stable/speedtest-prometheus/Chart.yaml index 7b2b185f..99ba162a 100644 --- a/charts/stable/speedtest-prometheus/Chart.yaml +++ b/charts/stable/speedtest-prometheus/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: speedtest-prometheus description: Prometheus Exporter for the official Speedtest CLI type: application -version: 2.1.3 +version: 2.2.0 appVersion: 1.1.0 keywords: - speedtest diff --git a/charts/stable/speedtest-prometheus/README.md b/charts/stable/speedtest-prometheus/README.md index b1e0e4c2..743396bd 100644 --- a/charts/stable/speedtest-prometheus/README.md +++ b/charts/stable/speedtest-prometheus/README.md @@ -1,6 +1,6 @@ # speedtest-prometheus -![Version: 2.1.3](https://img.shields.io/badge/Version-2.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) +![Version: 2.2.0](https://img.shields.io/badge/Version-2.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) Prometheus Exporter for the official Speedtest CLI @@ -101,6 +101,12 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.2.0] + +#### Added + +- namespace selection for the serviceMonitor + ### [2.1.1] #### Added diff --git a/charts/stable/speedtest-prometheus/README_CHANGELOG.md.gotmpl b/charts/stable/speedtest-prometheus/README_CHANGELOG.md.gotmpl index b830ef11..f78ff839 100644 --- a/charts/stable/speedtest-prometheus/README_CHANGELOG.md.gotmpl +++ b/charts/stable/speedtest-prometheus/README_CHANGELOG.md.gotmpl @@ -9,6 +9,12 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.2.0] + +#### Added + +- namespace selection for the serviceMonitor + ### [2.1.1] #### Added diff --git a/charts/stable/speedtest-prometheus/templates/servicemonitor.yaml b/charts/stable/speedtest-prometheus/templates/servicemonitor.yaml index b18862cf..adeab4a0 100644 --- a/charts/stable/speedtest-prometheus/templates/servicemonitor.yaml +++ b/charts/stable/speedtest-prometheus/templates/servicemonitor.yaml @@ -3,12 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "speedtest-prometheus.fullname" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} labels: {{- include "speedtest-prometheus.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} selector: matchLabels: {{- include "speedtest-prometheus.selectorLabels" . | nindent 6 }} diff --git a/charts/stable/speedtest-prometheus/values.yaml b/charts/stable/speedtest-prometheus/values.yaml index e2db71a8..9348374a 100644 --- a/charts/stable/speedtest-prometheus/values.yaml +++ b/charts/stable/speedtest-prometheus/values.yaml @@ -52,5 +52,5 @@ serviceMonitor: enabled: false interval: "60m" scrapeTimeout: 90s - # namespace: default + # namespace: monitoring additionalLabels: {}