Skip to content

Commit

Permalink
Add values for service monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmamorim committed Apr 1, 2024
1 parent a2d40c8 commit 4873c2f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
18 changes: 0 additions & 18 deletions helm/templates/service_metrics.yaml

This file was deleted.

12 changes: 8 additions & 4 deletions helm/templates/service_monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.serviceMonitor.create }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand All @@ -7,12 +8,15 @@ metadata:
{{- include "poolboy.labels" . | nindent 4 }}
spec:
endpoints:
- interval: 30s
path: /metrics
port: {{ .Values.serviceMetrics.name}}
- interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
port: {{ .Values.serviceMonitor.portName }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
jobLabel: {{ include "poolboy.name" . }}
namespaceSelector:
matchNames:
- {{ include "poolboy.namespaceName" . }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "poolboy.name" . }}
{{- include "poolboy.selectorLabels" . | nindent 6 }}
{{- end }}
24 changes: 14 additions & 10 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,31 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name:

serviceMonitor:
# ServiceMonitor requires prometheus-operator installed in the cluster
create: true
# The port name of the service monitor to use.
portName: metrics
# The path to scrape metrics from
path: /metrics
# How often Prometheus should scrape
interval: 30s
# How long Prometheus should wait for a scrape to complete
scrapeTimeout: 15s

service:
type: ClusterIP
port: 8080
ports:
- name: health-check
- name: healthz
port: 8080
protocol: TCP
targetPort: 8080

serviceMetrics:
type: ClusterIP
port: 80
name: metrics
ports:
- name: metrics
port: 80
protocol: TCP
targetPort: 8000
path: /metrics



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 4873c2f

Please sign in to comment.