-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ServiceMonitor support to helm chart (#2929)
- Loading branch information
1 parent
c5ec9ac
commit f658f05
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
operations/pyroscope/helm/pyroscope/templates/servicemonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{{- if .Values.serviceMonitor.enabled }} | ||
{{- $global := . }} | ||
{{- $serviceMonitor := .Values.serviceMonitor }} | ||
{{- range $component, $cfg := (fromYaml (include "pyroscope.components" .)) }} | ||
{{- with $global }} | ||
{{- $values := mustMergeOverwrite (deepCopy .Values.pyroscope ) ($cfg | default dict)}} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ $cfg.name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "pyroscope.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: {{ $component | quote }} | ||
{{- with $serviceMonitor.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $serviceMonitor.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- with $serviceMonitor.namespaceSelector }} | ||
namespaceSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "pyroscope.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/component: {{ $component | quote }} | ||
{{- with $serviceMonitor.matchExpressions }} | ||
matchExpressions: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
endpoints: | ||
- port: {{ $values.service.port_name }} | ||
{{- with $serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with $serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
{{- with $serviceMonitor.relabelings }} | ||
relabelings: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with $serviceMonitor.metricRelabelings }} | ||
metricRelabelings: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with $serviceMonitor.scheme }} | ||
scheme: {{ . }} | ||
{{- end }} | ||
{{- with $serviceMonitor.tlsConfig }} | ||
tlsConfig: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with $serviceMonitor.targetLabels }} | ||
targetLabels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters