k8s-manifests/rds/base/charts/jaeger/templates/collector-servicemonitor.yaml

39 lines
1.3 KiB
YAML

{{- if and (.Values.collector.enabled) (.Values.collector.serviceMonitor.enabled)}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "jaeger.collector.name" . }}
{{- if .Values.collector.serviceMonitor.namespace }}
namespace: {{ .Values.collector.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: collector
{{- if .Values.collector.serviceMonitor.additionalLabels }}
{{- toYaml .Values.collector.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
{{- if .Values.collector.serviceMonitor.annotations }}
annotations:
{{- toYaml .Values.collector.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: admin
path: /metrics
{{- if .Values.collector.serviceMonitor.interval }}
interval: {{ .Values.collector.serviceMonitor.interval }}
{{- end }}
{{- if .Values.collector.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.collector.serviceMonitor.scrapeTimeout }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/component: collector
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}