github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-prometheus-stack/templates/thanos-ruler/ingress.yaml (about) 1 {{- if and .Values.thanosRuler.enabled .Values.thanosRuler.ingress.enabled }} 2 {{- $pathType := .Values.thanosRuler.ingress.pathType | default "ImplementationSpecific" }} 3 {{- $serviceName := include "kube-prometheus-stack.thanosRuler.name" . }} 4 {{- $servicePort := .Values.thanosRuler.service.port -}} 5 {{- $routePrefix := list .Values.thanosRuler.thanosRulerSpec.routePrefix }} 6 {{- $paths := .Values.thanosRuler.ingress.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 name: {{ $serviceName }} 13 namespace: {{ template "kube-prometheus-stack.namespace" . }} 14 {{- if .Values.thanosRuler.ingress.annotations }} 15 annotations: 16 {{ toYaml .Values.thanosRuler.ingress.annotations | indent 4 }} 17 {{- end }} 18 labels: 19 app: {{ template "kube-prometheus-stack.thanosRuler.name" . }} 20 {{- if .Values.thanosRuler.ingress.labels }} 21 {{ toYaml .Values.thanosRuler.ingress.labels | indent 4 }} 22 {{- end }} 23 {{ include "kube-prometheus-stack.labels" . | indent 4 }} 24 spec: 25 {{- if $apiIsStable }} 26 {{- if .Values.thanosRuler.ingress.ingressClassName }} 27 ingressClassName: {{ .Values.thanosRuler.ingress.ingressClassName }} 28 {{- end }} 29 {{- end }} 30 rules: 31 {{- if .Values.thanosRuler.ingress.hosts }} 32 {{- range $host := .Values.thanosRuler.ingress.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: {{ $servicePort }} 47 {{- else }} 48 serviceName: {{ $serviceName }} 49 servicePort: {{ $servicePort }} 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: {{ $servicePort }} 67 {{- else }} 68 serviceName: {{ $serviceName }} 69 servicePort: {{ $servicePort }} 70 {{- end }} 71 {{- end -}} 72 {{- end -}} 73 {{- if .Values.thanosRuler.ingress.tls }} 74 tls: 75 {{ tpl (toYaml .Values.thanosRuler.ingress.tls | indent 4) . }} 76 {{- end -}} 77 {{- end -}}