Collectd operator utilties
[demo.git] / vnfs / DAaaS / collection / charts / prometheus / templates / service.yaml
1 apiVersion: v1
2 kind: Service
3 metadata:
4   name: {{ template "prometheus.fullname" . }}-prometheus
5   labels:
6     app: {{ template "prometheus.name" . }}-prometheus
7 {{- if .Values.prometheus.service.annotations }}
8   annotations:
9 {{ toYaml .Values.prometheus.service.annotations | indent 4 }}
10 {{- end }}
11 spec:
12 {{- if .Values.prometheus.service.clusterIP }}
13   clusterIP: {{ .Values.prometheus.service.clusterIP }}
14 {{- end }}
15 {{- if .Values.prometheus.service.externalIPs }}
16   externalIPs:
17 {{ toYaml .Values.prometheus.service.externalIPs | indent 4 }}
18 {{- end }}
19 {{- if .Values.prometheus.service.loadBalancerIP }}
20   loadBalancerIP: {{ .Values.prometheus.service.loadBalancerIP }}
21 {{- end }}
22 {{- if .Values.prometheus.service.loadBalancerSourceRanges }}
23   loadBalancerSourceRanges:
24   {{- range $cidr := .Values.prometheus.service.loadBalancerSourceRanges }}
25     - {{ $cidr }}
26   {{- end }}
27 {{- end }}
28   ports:
29   - name: web
30     {{- if eq .Values.prometheus.service.type "NodePort" }}
31     nodePort: {{ .Values.global.nodePortPrefix }}{{ .Values.prometheus.service.nodePort }}
32     {{- end }}
33     port: 9090
34     targetPort: web
35   selector:
36     app: prometheus
37     prometheus: {{ template "prometheus.fullname" . }}-prometheus
38   type: "{{ .Values.prometheus.service.type }}"