Extend K8S and RIC installation instructions
[it/dep.git] / ric-infra / 30-Kong / helm / kong / charts / kong / templates / servicemonitor.yaml
1 {{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.serviceMonitor.enabled }}
2 apiVersion: monitoring.coreos.com/v1
3 kind: ServiceMonitor
4 metadata:
5   name: {{ template "kong.fullname" . }}
6   {{- if .Values.serviceMonitor.namespace }}
7   namespace: {{ .Values.serviceMonitor.namespace }}
8   {{- end }}
9   labels:
10     app: {{ template "kong.name" . }}
11     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
12     heritage: {{ .Release.Service }}
13     release: {{ .Release.Name }}
14 spec:
15   endpoints:
16   - targetPort: metrics
17     scheme: http
18     {{- if .Values.serviceMonitor.interval }}
19     interval: {{ .Values.serviceMonitor.interval }}
20     {{- end }}
21   jobLabel: {{ .Release.Name }}
22   namespaceSelector:
23     matchNames:
24     - {{ .Release.Namespace }}
25   selector:
26     matchLabels:
27       app: {{ template "kong.name" . }}
28       release: {{ .Release.Name }}
29 {{- end }}