{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "fluent-bit.fullname" . }} {{- with .Values.serviceMonitor.namespace }} namespace: {{ . }} {{- end }} labels: {{- include "fluent-bit.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.selector }} {{- toYaml . | nindent 4 }} {{- end }} spec: endpoints: - port: http path: /api/v1/metrics/prometheus {{- with .Values.serviceMonitor.interval }} interval: {{ . }} {{- end }} {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} selector: matchLabels: {{- include "fluent-bit.selectorLabels" . | nindent 6 }} {{- end }}