github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-prometheus-stack/templates/prometheus/ingressThanosSidecar.yaml (about) 1 {{- if and .Values.prometheus.enabled .Values.prometheus.thanosIngress.enabled }} 2 {{- $pathType := .Values.prometheus.thanosIngress.pathType | default "" }} 3 {{- $serviceName := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "prometheus" }} 4 {{- $thanosPort := .Values.prometheus.thanosIngress.servicePort -}} 5 {{- $routePrefix := list .Values.prometheus.prometheusSpec.routePrefix }} 6 {{- $paths := .Values.prometheus.thanosIngress.paths | default $routePrefix -}} 7 {{- $apiIsStable := eq (include "kube-prometheus-stack.ingress.isStable" .) "true" -}} 8 {{- $ingressSupportsPathType := eq (include "kube-prometheus-stack.ingress.supportsPathType" .) "true" -}} 9 apiVersion: {{ include "kube-prometheus-stack.ingress.apiVersion" . }} 10 kind: Ingress 11 metadata: 12 {{- if .Values.prometheus.thanosIngress.annotations }} 13 annotations: 14 {{ toYaml .Values.prometheus.thanosIngress.annotations | indent 4 }} 15 {{- end }} 16 name: {{ template "kube-prometheus-stack.fullname" . }}-thanos-gateway 17 namespace: {{ template "kube-prometheus-stack.namespace" . }} 18 labels: 19 app: {{ template "kube-prometheus-stack.name" . }}-prometheus 20 {{ include "kube-prometheus-stack.labels" . | indent 4 }} 21 {{- if .Values.prometheus.thanosIngress.labels }} 22 {{ toYaml .Values.prometheus.thanosIngress.labels | indent 4 }} 23 {{- end }} 24 spec: 25 {{- if $apiIsStable }} 26 {{- if .Values.prometheus.thanosIngress.ingressClassName }} 27 ingressClassName: {{ .Values.prometheus.thanosIngress.ingressClassName }} 28 {{- end }} 29 {{- end }} 30 rules: 31 {{- if .Values.prometheus.thanosIngress.hosts }} 32 {{- range $host := .Values.prometheus.thanosIngress.hosts }} 33 - host: {{ tpl $host $ }} 34 http: 35 paths: 36 {{- range $p := $paths }} 37 - path: {{ tpl $p $ }} 38 {{- if and $pathType $ingressSupportsPathType }} 39 pathType: {{ $pathType }} 40 {{- end }} 41 backend: 42 {{- if $apiIsStable }} 43 service: 44 name: {{ $serviceName }} 45 port: 46 number: {{ $thanosPort }} 47 {{- else }} 48 serviceName: {{ $serviceName }} 49 servicePort: {{ $thanosPort }} 50 {{- end }} 51 {{- end -}} 52 {{- end -}} 53 {{- else }} 54 - http: 55 paths: 56 {{- range $p := $paths }} 57 - path: {{ tpl $p $ }} 58 {{- if and $pathType $ingressSupportsPathType }} 59 pathType: {{ $pathType }} 60 {{- end }} 61 backend: 62 {{- if $apiIsStable }} 63 service: 64 name: {{ $serviceName }} 65 port: 66 number: {{ $thanosPort }} 67 {{- else }} 68 serviceName: {{ $serviceName }} 69 servicePort: {{ $thanosPort }} 70 {{- end }} 71 {{- end -}} 72 {{- end -}} 73 {{- if .Values.prometheus.thanosIngress.tls }} 74 tls: 75 {{ tpl (toYaml .Values.prometheus.thanosIngress.tls | indent 4) . }} 76 {{- end -}} 77 {{- end -}}