Skip to content

Commit

Permalink
Merge pull request #146 from holaplex/mpw/treasuries-servicemon
Browse files Browse the repository at this point in the history
add servicemonitor to hub-treasuries
  • Loading branch information
mpwsh authored Sep 14, 2023
2 parents 759644a + 3fe41ef commit 9b36b3a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/hub-treasuries/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.0
version: 0.7.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
26 changes: 26 additions & 0 deletions charts/hub-treasuries/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,29 @@ spec:
name: http
selector:
{{- include "hub-treasuries.selectorLabels" . | nindent 4 }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "hub-treasuries.fullname" . }}
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "hub-treasuries.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- path: /metrics
port: http
scheme: {{ .Values.serviceMonitor.scheme }}
interval: {{ .Values.serviceMonitor.scrapeInterval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hub-treasuries.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
7 changes: 7 additions & 0 deletions charts/hub-treasuries/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ service:
type: ClusterIP
port: 80

serviceMonitor:
enabled: true
scheme: http
scrapeInterval: 60s
scrapeTimeout: 30s
labels: {}

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit 9b36b3a

Please sign in to comment.