Skip to content

Commit

Permalink
Merge pull request #157 from holaplex/mpw/upload-chart-metrics
Browse files Browse the repository at this point in the history
add serviceMonitor to uploads chart
  • Loading branch information
mpwsh authored Oct 6, 2023
2 parents db4b48b + 5c3fc76 commit f66efbd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/hub-uploads/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.1.1
version: 0.1.2

# 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-uploads/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-uploads.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-uploads.fullname" . }}
{{- if .Release.Namespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "hub-uploads.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-uploads.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

0 comments on commit f66efbd

Please sign in to comment.