aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/prometheus-operator/templates/alertmanager/service.yaml
blob: d10bf74583e53cd0ff8eb870756e50c439d784ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{{- if .Values.alertmanager.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "prometheus-operator.fullname" . }}-alertmanager
  labels:
    app: {{ template "prometheus-operator.name" . }}-alertmanager
{{ include "prometheus-operator.labels" . | indent 4 }}
{{- if .Values.alertmanager.service.annotations }}
  annotations:
{{ toYaml .Values.alertmanager.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.alertmanager.service.clusterIP }}
  clusterIP: {{ .Values.alertmanager.service.clusterIP }}
{{- end }}
{{- if .Values.alertmanager.service.externalIPs }}
  externalIPs:
{{ toYaml .Values.alertmanager.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.service.loadBalancerIP }}
  loadBalancerIP: {{ .Values.alertmanager.service.loadBalancerIP }}
{{- end }}
{{- if .Values.alertmanager.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
  {{- range $cidr := .Values.alertmanager.service.loadBalancerSourceRanges }}
    - {{ $cidr }}
  {{- end }}
{{- end }}
  ports:
    - name: web
    {{- if eq .Values.alertmanager.service.type "NodePort" }}
      nodePort: {{ .Values.alertmanager.service.nodePort }}
    {{- end }}
      port: 9093
      targetPort: 9093
      protocol: TCP
  selector:
    app: alertmanager
    alertmanager: {{ template "prometheus-operator.fullname" . }}-alertmanager
  type: "{{ .Values.alertmanager.service.type }}"
{{- end }}