123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- {{- if and .Values.controller.prometheus.enabled }}
- apiVersion: monitoring.coreos.com/v1
- kind: ServiceMonitor
- metadata:
- name: {{ template "jenkins.fullname" . }}
- {{- if .Values.controller.prometheus.serviceMonitorNamespace }}
- namespace: {{ .Values.controller.prometheus.serviceMonitorNamespace }}
- {{- else }}
- namespace: {{ template "jenkins.namespace" . }}
- {{- end }}
- labels:
- "app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
- {{- if .Values.renderHelmLabels }}
- "helm.sh/chart": "{{ template "jenkins.label" .}}"
- {{- end }}
- "app.kubernetes.io/managed-by": "{{ .Release.Service }}"
- "app.kubernetes.io/instance": "{{ .Release.Name }}"
- "app.kubernetes.io/component": "{{ .Values.controller.componentName }}"
- {{- range $key, $val := .Values.controller.prometheus.serviceMonitorAdditionalLabels }}
- {{ $key }}: {{ $val | quote }}
- {{- end}}
- spec:
- endpoints:
- - interval: {{ .Values.controller.prometheus.scrapeInterval }}
- port: http
- path: {{ .Values.controller.jenkinsUriPrefix }}{{ .Values.controller.prometheus.scrapeEndpoint }}
- {{- with .Values.controller.prometheus.relabelings }}
- relabelings:
- {{- toYaml . | nindent 6 }}
- {{- end }}
- {{- with .Values.controller.prometheus.metricRelabelings }}
- metricRelabelings:
- {{- toYaml . | nindent 6 }}
- {{- end }}
- jobLabel: {{ template "jenkins.fullname" . }}
- namespaceSelector:
- matchNames:
- - "{{ template "jenkins.namespace" $ }}"
- selector:
- matchLabels:
- "app.kubernetes.io/instance": "{{ .Release.Name }}"
- "app.kubernetes.io/component": "{{ .Values.controller.componentName }}"
- {{- end }}
|