Skip to content

Commit 7a03073

Browse files
authored
feat: added serviceMonitor support for unleash and unleash-edge charts (#199)
1 parent 8005f1b commit 7a03073

7 files changed

Lines changed: 62 additions & 3 deletions

File tree

charts/unleash-edge/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ icon: https://docs.getunleash.io/img/logo.svg
55

66
type: application
77

8-
version: 3.0.3
9-
appVersion: "v19.11.1"
8+
version: 3.0.4
9+
appVersion: "v19.11.3"
1010

1111
maintainers:
1212
- name: chriswk
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
serviceMonitor:
2+
enabled: true
3+
extraLabels:
4+
app.kubernetes.io/part-of: unleash
5+
app.kubernetes.io/component: service-monitor
6+
extraSelectorLabels:
7+
app.kubernetes.io/part-of: unleash
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if and .Values.serviceMonitor .Values.serviceMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: unleash-edge-service-monitor
6+
labels:
7+
{{- include "unleash-edge.labels" . | nindent 4 }}
8+
{{- if .Values.serviceMonitor.extraLabels }}
9+
{{- toYaml .Values.serviceMonitor.extraLabels | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
selector:
13+
matchLabels:
14+
{{- include "unleash-edge.selectorLabels" . | nindent 8 }}
15+
{{- if .Values.serviceMonitor.extraSelectorLabels }}
16+
{{- toYaml .Values.serviceMonitor.extraSelectorLabels | nindent 8 }}
17+
{{- end }}
18+
endpoints:
19+
- port: http
20+
path: /internal-backstage/metrics
21+
{{- end }}

charts/unleash-edge/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,8 @@ podDisruptionBudget:
184184
maxUnavailable: 1
185185

186186
priorityClassName: ""
187+
188+
serviceMonitor:
189+
enabled: false
190+
extraLabels: {}
191+
extraSelectorLabels: {}

charts/unleash/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ icon: https://docs.getunleash.io/img/logo.svg
55

66
type: application
77

8-
version: 5.6.0
8+
version: 5.6.1
99

1010
appVersion: "7.0.1"
1111

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if and .Values.serviceMonitor .Values.serviceMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: unleash-service-monitor
6+
labels:
7+
{{- include "unleash.labels" . | nindent 4 }}
8+
{{- if .Values.serviceMonitor.extraLabels }}
9+
{{- toYaml .Values.serviceMonitor.extraLabels | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
selector:
13+
matchLabels:
14+
{{- include "unleash.selectorLabels" . | nindent 8 }}
15+
{{- if .Values.serviceMonitor.extraSelectorLabels }}
16+
{{- toYaml .Values.serviceMonitor.extraSelectorLabels | nindent 8 }}
17+
{{- end }}
18+
endpoints:
19+
- port: http
20+
path: /internal-backstage/prometheus
21+
{{- end }}

charts/unleash/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,8 @@ topologySpreadConstraints:
290290
# Add additional volumes and mounts, for example to read other secrets.
291291
volumes: []
292292
volumeMounts: []
293+
294+
serviceMonitor:
295+
enabled: false
296+
extraLabels: {}
297+
extraSelectorLabels: {}

0 commit comments

Comments
 (0)