{{- if and (.Values.metrics.enabled) (.Values.metrics.prometheusExport) -}} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: {{ include "externalip-webhook.labels" . | indent 4 }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} name: {{ template "externalip-webhook.fullname" . }}-monitor namespace: {{ .Release.Namespace }} spec: endpoints: - path: /metrics port: https selector: matchLabels: app: {{ template "externalip-webhook.name" . }} {{- end }}