mirror of https://git.rancher.io/charts
48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
{{- if .Values.alertmanager.enabled }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-alertmanager
|
|
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
|
labels:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-alertmanager
|
|
self-monitor: {{ .Values.alertmanager.serviceMonitor.selfMonitor | quote }}
|
|
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
|
{{- if .Values.alertmanager.service.labels }}
|
|
{{ toYaml .Values.alertmanager.service.labels | indent 4 }}
|
|
{{- end }}
|
|
{{- 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: {{ .Values.alertmanager.alertmanagerSpec.portName }}
|
|
{{- if eq .Values.alertmanager.service.type "NodePort" }}
|
|
nodePort: {{ .Values.alertmanager.service.nodePort }}
|
|
{{- end }}
|
|
port: {{ .Values.alertmanager.service.port }}
|
|
targetPort: {{ .Values.alertmanager.service.targetPort }}
|
|
protocol: TCP
|
|
selector:
|
|
app: alertmanager
|
|
alertmanager: {{ template "kube-prometheus-stack.fullname" . }}-alertmanager
|
|
type: "{{ .Values.alertmanager.service.type }}"
|
|
{{- end }}
|