Add support for prometheus
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / prometheus / charts / kube-state-metrics / templates / service.yaml
1 apiVersion: v1
2 kind: Service
3 metadata:
4   name: {{ template "kube-state-metrics.fullname" . }}
5   namespace: {{ template "kube-state-metrics.namespace" . }}
6   labels:
7     app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
8     helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9     app.kubernetes.io/instance: "{{ .Release.Name }}"
10     app.kubernetes.io/managed-by: "{{ .Release.Service }}"
11 {{- if .Values.customLabels }}
12 {{ toYaml .Values.customLabels | indent 4 }}
13 {{- end }}
14   annotations:
15     {{- if .Values.prometheusScrape }}
16     prometheus.io/scrape: '{{ .Values.prometheusScrape }}'
17     {{- end }}
18     {{- if .Values.service.annotations }}
19     {{- toYaml .Values.service.annotations | nindent 4 }}
20     {{- end }}
21 spec:
22   type: "{{ .Values.service.type }}"
23   ports:
24   - name: "http"
25     protocol: TCP
26     port: {{ .Values.service.port }}
27   {{- if .Values.service.nodePort }}
28     nodePort: {{ .Values.service.nodePort }}
29   {{- end }}
30     targetPort: 8080
31 {{- if .Values.service.loadBalancerIP }}
32   loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
33 {{- end }}
34   selector:
35     app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
36     app.kubernetes.io/instance: {{ .Release.Name }}