rancher-partner-charts/charts/kubecost/cost-analyzer/2.5.2/templates/aggregator-servicemonitor.yaml

32 lines
1.1 KiB
YAML

{{- if .Values.serviceMonitor.aggregatorMetrics.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "aggregator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "aggregator.commonLabels" . | nindent 4 }}
{{- if .Values.serviceMonitor.aggregatorMetrics.additionalLabels }}
{{ toYaml .Values.serviceMonitor.aggregatorMetrics.additionalLabels | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: tcp-api
interval: {{ .Values.serviceMonitor.aggregatorMetrics.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.aggregatorMetrics.scrapeTimeout }}
path: /metrics
scheme: http
{{- with .Values.serviceMonitor.aggregatorMetrics.metricRelabelings }}
metricRelabelings: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.aggregatorMetrics.relabelings }}
relabelings: {{ toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "aggregator.commonLabels" . | nindent 6 }}
{{- end }}