Skip to content

Commit

Permalink
Merge pull request #39 from portefaix/feat/speedtest-exporter-service…
Browse files Browse the repository at this point in the history
…-monitor

Speedtest exporter : refactoring service monitor values
  • Loading branch information
nlamirault committed May 17, 2021
2 parents 8d62c6f + 1cf3710 commit 17f2aff
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 30 deletions.
2 changes: 1 addition & 1 deletion charts/speedtest-exporter/Chart.yaml
Expand Up @@ -28,7 +28,7 @@ keywords:
# 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: 0.1.0
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 2 additions & 7 deletions charts/speedtest-exporter/README.md
@@ -1,6 +1,6 @@
# speedtest-exporter

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.4](https://img.shields.io/badge/AppVersion-0.0.4-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.4](https://img.shields.io/badge/AppVersion-0.0.4-informational?style=flat-square)

A Helm chart for Prometheus Speedtest exporter

Expand Down Expand Up @@ -32,12 +32,6 @@ A Helm chart for Prometheus Speedtest exporter
| imagePullSecrets | list | `[]` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| prometheus.monitor.additionalLabels | object | `{}` | |
| prometheus.monitor.enabled | bool | `false` | |
| prometheus.monitor.honorLabels | bool | `false` | |
| prometheus.monitor.interval | string | `"60m"` | |
| prometheus.monitor.namespace | string | `""` | |
| prometheus.monitor.scrapeTimeout | string | `"60s"` | |
| readOnlyRootFilesystem | bool | `true` | |
| replicas | int | `1` | |
| resources | object | `{}` | |
Expand All @@ -55,6 +49,7 @@ A Helm chart for Prometheus Speedtest exporter
| serviceAccount.create | bool | `true` | |
| serviceAccount.imagePullSecrets | list | `[]` | |
| serviceAccount.name | string | `nil` | |
| serviceMonitor.enabled | bool | `false` | |
| tolerations | list | `[]` | |

----------------------------------------------
Expand Down
13 changes: 6 additions & 7 deletions charts/speedtest-exporter/ci/test-values.yaml
Expand Up @@ -15,10 +15,9 @@ resources:
cpu: 10m
memory: 32Mi

prometheus:
monitor:
enabled: true
interval: 15m
scrapeTimeout: 60s
additionalLabels:
release: kube-prometheus-stack
serviceMonitor:
enabled: true
interval: 15m
scrapeTimeout: 60s
additionalLabels:
release: kube-prometheus-stack
12 changes: 6 additions & 6 deletions charts/speedtest-exporter/templates/servicemonitor.yaml
@@ -1,4 +1,4 @@
{{- if .Values.prometheus.monitor.enabled }}
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand All @@ -12,8 +12,8 @@ metadata:
labels:
app: {{ template "speedtest-exporter.name" . }}
{{- include "speedtest-exporter.labels" . | indent 4 }}
{{- if .Values.prometheus.monitor.additionalLabels }}
{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }}
{{- if .Values.serviceMonitor.additionalLabels }}
{{ toYaml .Values.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
name: {{ template "speedtest-exporter.fullname" . }}
namespace: {{ template "speedtest-exporter.namespace" . }}
Expand All @@ -23,9 +23,9 @@ spec:
app: {{ template "speedtest-exporter.name" . }}
endpoints:
- port: http
interval: {{ .Values.prometheus.monitor.interval }}
scrapeTimeout: {{ .Values.prometheus.monitor.scrapeTimeout }}
{{- if .Values.prometheus.monitor.honorLabels }}
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- if .Values.serviceMonitor.honorLabels }}
honorLabels: true
{{- end }}
{{- end }}
15 changes: 6 additions & 9 deletions charts/speedtest-exporter/values.yaml
Expand Up @@ -82,12 +82,9 @@ resources: {}
# cpu: 10m
# memory: 32Mi

prometheus:
monitor:
enabled: false
interval: 60m
scrapeTimeout: 60s
additionalLabels: {}
# release: kube-prometheus-stack
namespace: ""
honorLabels: false
serviceMonitor:
enabled: false
# interval: 60m
# scrapeTimeout: 60s
# additionalLabels:
# release: kube-prometheus-stack

0 comments on commit 17f2aff

Please sign in to comment.