Skip to content

Commit

Permalink
Move portal at the end of the ingress paths
Browse files Browse the repository at this point in the history
According to the ingress specification [1], the longest matching path should
be used. But for Istio, "The first rule matching an incoming request is
used" [2,3].

[1]: https://kubernetes.io/docs/concepts/services-networking/ingress/#multiple-matches
[2]: https://istio.io/latest/docs/reference/config/networking/virtual-service/#VirtualService
[3]: istio/istio#35033

Fixes: goharbor#485
Signed-off-by: Mathieu Parent <[email protected]>
  • Loading branch information
sathieu committed Jan 12, 2022
1 parent a57ee9e commit 3036f2b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions templates/ingress/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ spec:
- http:
paths:
{{- if semverCompare "<1.19-0" (include "harbor.ingress.kubeVersion" .) }}
- path: {{ .portal_path }}
backend:
serviceName: {{ template "harbor.portal" . }}
servicePort: {{ template "harbor.portal.servicePort" . }}
- path: {{ .api_path }}
backend:
serviceName: {{ template "harbor.core" . }}
Expand All @@ -94,14 +90,11 @@ spec:
backend:
serviceName: {{ template "harbor.core" . }}
servicePort: {{ template "harbor.core.servicePort" . }}
{{- else }}
- path: {{ .portal_path }}
pathType: Prefix
backend:
service:
name: {{ template "harbor.portal" . }}
port:
number: {{ template "harbor.portal.servicePort" . }}
serviceName: {{ template "harbor.portal" . }}
servicePort: {{ template "harbor.portal.servicePort" . }}
{{- else }}
- path: {{ .api_path }}
pathType: Prefix
backend:
Expand Down Expand Up @@ -137,6 +130,13 @@ spec:
name: {{ template "harbor.core" . }}
port:
number: {{ template "harbor.core.servicePort" . }}
- path: {{ .portal_path }}
pathType: Prefix
backend:
service:
name: {{ template "harbor.portal" . }}
port:
number: {{ template "harbor.portal.servicePort" . }}
{{- end }}
{{- if $ingress.hosts.core }}
host: {{ $ingress.hosts.core }}
Expand Down

0 comments on commit 3036f2b

Please sign in to comment.