Skip to content

Commit b08f610

Browse files
authored
Dev/servicemonitor (#16)
* dev: add service-monitor to helm chart * fix: change name * fix: indent * add changes to values.yaml file to enable or disable service monitor
1 parent 8e7d901 commit b08f610

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

cr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ charts-dir: squadcast-helm
55
sign: false
66
charts_repo_url: https://squadcasthub.github.io/helm-infra
77
index-path: .
8-
version: 0.2.5
8+
version: 0.2.6

squadcast-helm/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ name: squadcast-helm
33
description: A Helm chart for Kubernetes
44
type: application
55

6-
version: 0.2.5
6+
version: 0.2.6
77

88
appVersion: "1.16.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if ((.Values.serviceMonitor)).enabled | default false }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
labels:
6+
team: SRE
7+
name: {{ include "squadcast-helm.fullname" . }}-metrics
8+
spec:
9+
endpoints:
10+
- interval: {{ .Values.serviceMonitor.interval | default "1m" }}
11+
port: {{ .Values.serviceMonitor.port_name | default "metrics" }}
12+
selector:
13+
matchLabels:
14+
{{- include "squadcast-helm.selectorLabels" . | nindent 6 }}
15+
{{- end }}

values.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ tolerations: []
8282

8383
affinity: {}
8484

85+
# To enable service monitor.
86+
serviceMonitor:
87+
enabled: false
88+
port_name: metrics
89+
8590
# cronjobs:
8691
# enabled: false
8792
# jobs:

0 commit comments

Comments
 (0)