mirror of https://git.rancher.io/charts
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
|
{{- if .Values.prometheus.monitor.enabled }}
|
||
|
apiVersion: monitoring.coreos.com/v1
|
||
|
kind: ServiceMonitor
|
||
|
metadata:
|
||
|
name: {{ template "kube-state-metrics.fullname" . }}
|
||
|
namespace: {{ template "kube-state-metrics.namespace" . }}
|
||
|
labels:
|
||
|
app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
|
||
|
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||
|
app.kubernetes.io/instance: "{{ .Release.Name }}"
|
||
|
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
|
||
|
{{- if .Values.prometheus.monitor.additionalLabels }}
|
||
|
{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.customLabels }}
|
||
|
{{ toYaml .Values.customLabels | indent 4 }}
|
||
|
{{- end }}
|
||
|
spec:
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||
|
endpoints:
|
||
|
- port: http
|
||
|
{{- if .Values.prometheus.monitor.honorLabels }}
|
||
|
honorLabels: true
|
||
|
{{- end }}
|
||
|
{{ if .Values.selfMonitor.enabled }}
|
||
|
- port: metrics
|
||
|
{{- if .Values.prometheus.monitor.honorLabels }}
|
||
|
honorLabels: true
|
||
|
{{- end }}
|
||
|
{{ end }}
|
||
|
{{- end }}
|