rancher-partner-charts/charts/kubecost/cost-analyzer/2.3.1/templates/prometheus-pushgateway-ingr...

39 lines
1.3 KiB
YAML
Raw Normal View History

2022-01-10 19:55:02 +00:00
{{ if .Values.global.prometheus.enabled }}
{{- if and .Values.prometheus.pushgateway.enabled .Values.prometheus.pushgateway.ingress.enabled -}}
2022-01-10 19:55:02 +00:00
{{- $releaseName := .Release.Name -}}
{{- $serviceName := include "prometheus.pushgateway.fullname" . }}
{{- $servicePort := .Values.prometheus.pushgateway.service.servicePort -}}
{{- $extraPaths := .Values.prometheus.pushgateway.ingress.extraPaths -}}
2022-01-10 19:55:02 +00:00
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{- if .Values.prometheus.pushgateway.ingress.annotations }}
2022-01-10 19:55:02 +00:00
annotations:
{{ toYaml .Values.prometheus.pushgateway.ingress.annotations | indent 4}}
2022-01-10 19:55:02 +00:00
{{- end }}
labels:
{{- include "prometheus.pushgateway.labels" . | nindent 4 }}
name: {{ template "prometheus.pushgateway.fullname" . }}
namespace: {{ .Release.Namespace }}
2022-01-10 19:55:02 +00:00
spec:
rules:
{{- range .Values.prometheus.pushgateway.ingress.hosts }}
2022-01-10 19:55:02 +00:00
{{- $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.pushgateway.ingress.tls }}
2022-01-10 19:55:02 +00:00
tls:
{{ toYaml .Values.prometheus.pushgateway.ingress.tls | indent 4 }}
2022-01-10 19:55:02 +00:00
{{- end -}}
{{- end -}}
{{ end }}