Skip to content

Commit 9b36b3a

Browse files
authored
Merge pull request #146 from holaplex/mpw/treasuries-servicemon
add servicemonitor to hub-treasuries
2 parents 759644a + 3fe41ef commit 9b36b3a

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

charts/hub-treasuries/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 0.6.0
21+
version: 0.7.0
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/hub-treasuries/templates/service.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,29 @@ spec:
1313
name: http
1414
selector:
1515
{{- include "hub-treasuries.selectorLabels" . | nindent 4 }}
16+
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
17+
---
18+
apiVersion: monitoring.coreos.com/v1
19+
kind: ServiceMonitor
20+
metadata:
21+
name: {{ include "hub-treasuries.fullname" . }}
22+
{{- if .Release.Namespace }}
23+
namespace: {{ .Release.Namespace }}
24+
{{- end }}
25+
labels:
26+
{{- include "hub-treasuries.labels" . | nindent 4 }}
27+
{{- with .Values.serviceMonitor.labels }}
28+
{{- toYaml . | nindent 4 }}
29+
{{- end }}
30+
spec:
31+
endpoints:
32+
- path: /metrics
33+
port: http
34+
scheme: {{ .Values.serviceMonitor.scheme }}
35+
interval: {{ .Values.serviceMonitor.scrapeInterval }}
36+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
37+
selector:
38+
matchLabels:
39+
app.kubernetes.io/name: {{ include "hub-treasuries.name" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- end -}}

charts/hub-treasuries/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ service:
4747
type: ClusterIP
4848
port: 80
4949

50+
serviceMonitor:
51+
enabled: true
52+
scheme: http
53+
scrapeInterval: 60s
54+
scrapeTimeout: 30s
55+
labels: {}
56+
5057
resources: {}
5158
# We usually recommend not to specify default resources and to leave this as a conscious
5259
# choice for the user. This also increases chances charts run on environments with little

0 commit comments

Comments
 (0)