Skip to content

Commit

Permalink
Merge pull request #4 from velothump/servicemonitor
Browse files Browse the repository at this point in the history
Prometheus ServiceMonitor support
  • Loading branch information
James Ranson authored Jun 2, 2020
2 parents 2abb814 + 8131b06 commit 78516f8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/trickster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 1.1
description: Trickster is an HTTP Reverse Proxy Cache and time series query accelerator.
name: trickster
version: 1.5.0
version: 1.6.0
home: https://github.com/tricksterproxy/trickster
icon: https://helm.tricksterproxy.io/img/trickster-horizontal.png
sources:
Expand Down
27 changes: 27 additions & 0 deletions charts/trickster/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.prometheus.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "trickster.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "trickster.labels" . | nindent 4 }}
{{- if .Values.prometheus.serviceMonitor.labels }}
{{ toYaml .Values.prometheus.serviceMonitor.labels | indent 4 }}
{{- end }}
spec:
jobLabel: {{ template "trickster.name" . }}
selector:
matchLabels:
{{- include "trickster.labels" . | nindent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: http-metrics
path: {{ .Values.service.metricsPort }}
interval: {{ .Values.prometheus.serviceMonitor.interval }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/trickster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,12 @@ profiler:

prometheusScrape: false

prometheus:
serviceMonitor:
enabled: false
interval: 30s
labels: {}

# Number of trickster replicas desired
## Use a StatefulSet if replicaCount needs to be greater than 1 (see below)
replicaCount: 1
Expand Down

0 comments on commit 78516f8

Please sign in to comment.