diff --git a/sickhub/mtr-exporter/Chart.yaml b/sickhub/mtr-exporter/Chart.yaml index d40a4b4..72dcf7c 100644 --- a/sickhub/mtr-exporter/Chart.yaml +++ b/sickhub/mtr-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: mtr-exporter description: A Helm chart for an mtr-exporter pod providing metrics. type: application -version: 0.0.1 +version: 0.0.2 # https://github.com/mgumz/mtr-exporter # https://github.com/mgumz/mtr-exporter/pkgs/container/mtr-exporter appVersion: "0.4.0" diff --git a/sickhub/mtr-exporter/templates/servicemonitor.yaml b/sickhub/mtr-exporter/templates/servicemonitor.yaml new file mode 100644 index 0000000..5962c7e --- /dev/null +++ b/sickhub/mtr-exporter/templates/servicemonitor.yaml @@ -0,0 +1,31 @@ +{{- if .Values.serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "mtr-exporter.fullname" . }} + labels: + {{- include "mtr-exporter.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.defaults.labels }} + {{- toYaml .Values.serviceMonitor.defaults.labels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: http + path: {{ .Values.serviceMonitor.path }} + interval: {{ .Values.serviceMonitor.defaults.interval }} + scrapeTimeout: {{ .Values.serviceMonitor.defaults.scrapeTimeout }} + honorTimestamps: {{ .Values.serviceMonitor.defaults.honorTimestamps }} + {{- if .Values.serviceMonitor.defaults.metricRelabelings }} + metricRelabelings: + {{ toYaml .Values.serviceMonitor.defaults.metricRelabelings | indent 6 }} + {{- end }} + {{- if .Values.serviceMonitor.defaults.additionalRelabelings }} + relabelings: + {{ toYaml .Values.serviceMonitor.defaults.additionalRelabelings | indent 6 }} + {{- end }} + jobLabel: "{{ .Release.Name }}" + selector: + matchLabels: + {{- include "mtr-exporter.labels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/sickhub/mtr-exporter/values.yaml b/sickhub/mtr-exporter/values.yaml index 07f92e9..13067e8 100644 --- a/sickhub/mtr-exporter/values.yaml +++ b/sickhub/mtr-exporter/values.yaml @@ -26,6 +26,22 @@ exporterJobs: [] # schedule: "@every 120s" # mtrFlags: "-G 1 example.com" +serviceMonitor: + enabled: false + path: /metrics + defaults: + interval: 60s + scrapeTimeout: 3s + honorTimestamps: true + metricRelabelings: {} + # - sourceLabels: [instance] + # targetLabel: instance + # replacement: {{ .url }} + # action: replace + additionalRelabelings: {} + labels: {} + # prometheus: default + # This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: # Specifies whether a service account should be created