{{- if and .Values.spiffe.rest.enabled .Values.spiffe.rest.ingress.enabled -}} {{- $port := .Values.spiffe.rest.service.port }} {{- $ingressControllerType := include "spire-lib.ingress-controller-type" (dict "global" .Values.global "ingress" .Values.spiffe.rest.ingress) }} {{- $fullName := printf "%s-rest-spiffe" (include "spire-identity-exchange.fullname" .) }} {{- $path := "/" }} {{- $pathType := "Prefix" }} {{- $tlsSection := true }} {{- $annotations := deepCopy .Values.spiffe.rest.ingress.annotations }} {{- if eq $ingressControllerType "ingress-nginx" }} {{- $_ := set $annotations "nginx.ingress.kubernetes.io/ssl-redirect" "true" }} {{- $_ := set $annotations "nginx.ingress.kubernetes.io/force-ssl-redirect" "true" }} {{- $_ := set $annotations "nginx.ingress.kubernetes.io/backend-protocol" "HTTPS" }} {{- if not .Values.spiffe.rest.ingress.tlsSecret }} {{- $_ := set $annotations "nginx.ingress.kubernetes.io/ssl-passthrough" "true" }} {{- end }} {{- else if eq $ingressControllerType "openshift" }} {{- if .Values.spiffe.rest.ingress.tlsSecret }} {{- $_ := set $annotations "route.openshift.io/termination" "reencrypt" }} {{- else }} {{- $_ := set $annotations "route.openshift.io/termination" "passthrough" }} {{- end }} {{- $path = "" }} {{- $pathType = "ImplementationSpecific" }} {{- $tlsSection = false }} {{- end }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} namespace: {{ include "spire-identity-exchange.namespace" . }} labels: {{ include "spire-identity-exchange.labels" . | nindent 4 }} {{- with $annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{ include "spire-lib.ingress-spec" (dict "ingress" .Values.spiffe.rest.ingress "svcName" $fullName "port" $port "path" $path "pathType" $pathType "tlsSection" $tlsSection "Values" .Values) | nindent 2 }} {{- end }}