rancher-partner-charts/charts/kubecost/cost-analyzer/2.3.1/templates/prometheus-alertmanager-ser...

56 lines
2.0 KiB
YAML

{{ if .Values.global.prometheus.enabled }}
{{- if .Values.prometheus.alertmanager.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.prometheus.alertmanager.service.annotations }}
annotations:
{{ toYaml .Values.prometheus.alertmanager.service.annotations | indent 4 }}
{{- end }}
labels:
{{- include "prometheus.alertmanager.labels" . | nindent 4 }}
{{- if .Values.prometheus.alertmanager.service.labels }}
{{ toYaml .Values.prometheus.alertmanager.service.labels | indent 4 }}
{{- end }}
name: {{ template "prometheus.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.prometheus.alertmanager.service.clusterIP }}
clusterIP: {{ .Values.prometheus.alertmanager.service.clusterIP }}
{{- end }}
{{- if .Values.prometheus.alertmanager.service.externalIPs }}
externalIPs:
{{ toYaml .Values.prometheus.alertmanager.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.prometheus.alertmanager.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.prometheus.alertmanager.service.loadBalancerIP }}
{{- end }}
{{- if .Values.prometheus.alertmanager.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.prometheus.alertmanager.service.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.prometheus.alertmanager.service.servicePort }}
protocol: TCP
targetPort: 9093
{{- if .Values.prometheus.alertmanager.service.nodePort }}
nodePort: {{ .Values.prometheus.alertmanager.service.nodePort }}
{{- end }}
{{- if .Values.prometheus.alertmanager.service.enableMeshPeer }}
- name: meshpeer
port: 6783
protocol: TCP
targetPort: 6783
{{- end }}
selector:
{{- include "prometheus.alertmanager.matchLabels" . | nindent 4 }}
{{- if .Values.prometheus.alertmanager.service.sessionAffinity }}
sessionAffinity: {{ .Values.prometheus.alertmanager.service.sessionAffinity }}
{{- end }}
type: "{{ .Values.prometheus.alertmanager.service.type }}"
{{- end }}
{{ end }}