{{- if .Values.serviceMonitor }}{{- if .Values.serviceMonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "pushprox.serviceMonitor.name" . }} namespace: {{ template "pushprox.namespace" . }} labels: {{ include "pushProxy.serviceMonitor.labels" . | nindent 4 }} spec: endpoints: - port: metrics proxyUrl: {{ template "pushProxy.proxyUrl" . }} {{- if .Values.clients.https.enabled }} params: _scheme: [https] {{- end }} jobLabel: component podTargetLabels: - component - pushprox-exporter namespaceSelector: matchNames: - {{ template "pushprox.namespace" . }} selector: matchLabels: {{ include "pushProxy.client.labels" . | nindent 6 }} --- apiVersion: v1 kind: Service metadata: name: {{ template "pushProxy.client.name" . }} namespace: {{ template "pushprox.namespace" . }} labels: {{ include "pushProxy.client.labels" . | nindent 4 }} spec: ports: - name: metrics port: {{ required "Need .Values.metricsPort to configure client to listen to metrics at port" .Values.metricsPort}} protocol: TCP targetPort: {{ .Values.metricsPort }} selector: {{ include "pushProxy.client.labels" . | nindent 4 }} {{- end }}{{- end }}