2024-09-29 20:10:50 +00:00
|
|
|
{{- with .Values.monitoring -}}
|
|
|
|
{{- if and .enabled ($.Capabilities.APIVersions.Has .apiVersion) -}}
|
|
|
|
{{- $endpointsKey := (eq .kind "PodMonitor") | ternary "podMetricsEndpoints" "endpoints" -}}
|
|
|
|
apiVersion: {{ .apiVersion }}
|
|
|
|
kind: {{ .kind }}
|
|
|
|
metadata:
|
|
|
|
{{- with .annotations }}
|
|
|
|
annotations: {{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
labels: {{- include "wg-portal.util.merge" (list $ .labels "wg-portal.labels") | nindent 4 }}
|
|
|
|
name: {{ include "wg-portal.fullname" $ }}
|
|
|
|
spec:
|
|
|
|
namespaceSelector:
|
|
|
|
matchNames:
|
|
|
|
- {{ $.Release.Namespace }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "wg-portal.selectorLabels" $ | nindent 6 }}
|
|
|
|
{{ $endpointsKey }}:
|
|
|
|
- port: metrics
|
|
|
|
path: /metrics
|
2024-10-09 20:33:50 +00:00
|
|
|
interval: {{ coalesce .interval ($.Values.config.statistics).data_collection_interval "1m" }}
|
2024-09-29 20:10:50 +00:00
|
|
|
{{- with .metricRelabelings }}
|
|
|
|
metricRelabelings: {{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .relabelings }}
|
|
|
|
relabelings: {{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .scrapeTimeout }}
|
|
|
|
scrapeTimeout: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .jobLabel }}
|
|
|
|
jobLabel: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .podTargetLabels }}
|
|
|
|
podTargetLabels: {{- toYaml . | nindent 2 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|