Skip to content

Commit

Permalink
Adding service monitor (#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinrajadurai3 authored Sep 21, 2021
1 parent e941e18 commit ef2119e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spot-termination-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: spot-termination-exporter
home: https://banzaicloud.com
sources:
- https://github.com/banzaicloud/banzai-charts
version: 0.0.9
version: 0.0.10
description: Spot Termination exporter Helm chart for Kubernetes
keywords:
- spot
Expand Down
24 changes: 24 additions & 0 deletions spot-termination-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.spotTerminationexporter.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "spotTerminationexporter.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "spotTerminationexporter.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.spotTerminationexporter.serviceMonitor.additionalLabels }}
{{ toYaml .Values.spotTerminationexporter.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
spec:
endpoints:
- port: http
jobLabel: {{ include "spotTerminationexporter.name" . }}
namespaceSelector:
matchNames:
- "{{ $.Release.Namespace }}"
selector:
matchLabels:
app: {{ include "spotTerminationexporter.name" . }}
{{ end }}
7 changes: 6 additions & 1 deletion spot-termination-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ spotTerminationexporter:
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
# annotations:


serviceMonitor:
# enabled should be set to true to enable prometheus-operator discovery of this service
enabled: false
# additionalLabels is the set of additional labels to add to the ServiceMonitor
additionalLabels: {}

logLevel: "debug"

Expand Down

0 comments on commit ef2119e

Please sign in to comment.