Skip to content

Commit

Permalink
Merge pull request #112 from dasmeta/service_monitor
Browse files Browse the repository at this point in the history
add service monitor to base chart
  • Loading branch information
hb90dev committed Aug 20, 2024
2 parents d655064 + f3a468d commit 148f16b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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.2.2
version: 0.2.3

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.2"
appVersion: "0.2.3"
19 changes: 19 additions & 0 deletions charts/base/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
endpoints:
- interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
targetPort: {{ .Values.serviceMonitor.targetPort }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "base.labels" . | nindent 6 }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,9 @@ pdb:
enabled: false
minAvailable: 1
pdbName:

serviceMonitor:
enabled: false
interval: 30s
targetPort: 80
path: /metrics

0 comments on commit 148f16b

Please sign in to comment.