rancher-partner-charts/charts/kubecost/cost-analyzer/2.0.2/templates/prometheus-alertmanager-ing...

42 lines
1.5 KiB
YAML

{{ if .Values.global.prometheus.enabled }}
{{- if and .Values.prometheus.alertmanager.enabled .Values.prometheus.alertmanager.ingress.enabled -}}
{{- $releaseName := .Release.Name -}}
{{- $serviceName := include "prometheus.alertmanager.fullname" . }}
{{- $servicePort := .Values.prometheus.alertmanager.service.servicePort -}}
{{- $extraPaths := .Values.prometheus.alertmanager.ingress.extraPaths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{- if .Values.prometheus.alertmanager.ingress.annotations }}
annotations:
{{ toYaml .Values.prometheus.alertmanager.ingress.annotations | indent 4 }}
{{- end }}
labels:
{{- include "prometheus.alertmanager.labels" . | nindent 4 }}
{{- range $key, $value := .Values.prometheus.alertmanager.ingress.extraLabels }}
{{ $key }}: {{ $value }}
{{- end }}
name: {{ template "prometheus.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
rules:
{{- range .Values.prometheus.alertmanager.ingress.hosts }}
{{- $url := splitList "/" . }}
- host: {{ first $url }}
http:
paths:
{{ if $extraPaths }}
{{ toYaml $extraPaths | indent 10 }}
{{- end }}
- path: /{{ rest $url | join "/" }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- if .Values.prometheus.alertmanager.ingress.tls }}
tls:
{{ toYaml .Values.prometheus.alertmanager.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
{{ end }}