|
| 1 | +{{- if and (not .Values.metrics.podMonitor.enabled) .Values.metrics.serviceMonitor.enabled }} |
| 2 | +apiVersion: monitoring.coreos.com/v1 |
| 3 | +kind: ServiceMonitor |
| 4 | +metadata: |
| 5 | + name: {{ include "retina.fullname" . }} |
| 6 | + namespace: {{ ternary .Values.metrics.serviceMonitor.namespace .Values.namespace (not (empty .Values.metrics.serviceMonitor.namespace)) }} |
| 7 | + labels: |
| 8 | + k8s-app: {{ include "retina.name" . }} |
| 9 | + {{- include "retina.labels" . | nindent 4 }} |
| 10 | + app.kubernetes.io/component: metrics |
| 11 | + {{- if .Values.metrics.serviceMonitor.additionalLabels }} |
| 12 | + {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} |
| 13 | + {{- end }} |
| 14 | +spec: |
| 15 | + endpoints: |
| 16 | + - targetPort: retina |
| 17 | + path: /metrics |
| 18 | + {{- if .Values.metrics.serviceMonitor.interval }} |
| 19 | + interval: {{ .Values.metrics.serviceMonitor.interval }} |
| 20 | + {{- end }} |
| 21 | + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} |
| 22 | + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} |
| 23 | + {{- end }} |
| 24 | + {{- if .Values.metrics.serviceMonitor.scheme }} |
| 25 | + scheme: {{ .Values.metrics.serviceMonitor.scheme }} |
| 26 | + {{- end }} |
| 27 | + {{- if .Values.metrics.serviceMonitor.tlsConfig }} |
| 28 | + tlsConfig: {{- .Values.metrics.serviceMonitor.tlsConfig | nindent 8 }} |
| 29 | + {{- end }} |
| 30 | + {{- if .Values.metrics.serviceMonitor.relabelings }} |
| 31 | + relabelings: |
| 32 | + {{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 8 }} |
| 33 | + {{- end }} |
| 34 | + {{- if .Values.metrics.serviceMonitor.metricRelabelings }} |
| 35 | + metricRelabelings: |
| 36 | + {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 8 }} |
| 37 | + {{- end }} |
| 38 | + namespaceSelector: |
| 39 | + matchNames: |
| 40 | + - {{ .Values.namespace }} |
| 41 | + selector: |
| 42 | + matchLabels: |
| 43 | + {{- include "retina.selectorLabels" . | nindent 6 }} |
| 44 | + app.kubernetes.io/component: networking |
| 45 | +{{- end }} |
0 commit comments