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