-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add service monitor on helm chart
Allow configuration of service monitor in order to have metrics collected by an external prometheus Signed-off-by: Nicolas Trangosi <nicolas.trangosi@dcbrain.com>
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.serviceMonitor.enabled }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "scaphandre.name" . }}-service-monitoring | ||
{{- if .Values.serviceMonitor.namespace }} | ||
namespace: {{ .Values.serviceMonitor.namespace }} | ||
{{- else }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} | ||
labels: | ||
app.kubernetes.io/name: {{ template "scaphandre.name" . }} | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
port: metrics | ||
scheme: http | ||
{{- if .Values.serviceMonitor.interval }} | ||
interval: {{ .Values.serviceMonitor.interval }} | ||
{{- end }} | ||
scrapeTimeout: 30s | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "scaphandre.name" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters