diff --git a/templates/ingress/ingresshost.yaml b/templates/ingress/ingresshost.yaml index 9c775858c49c3bb467ffbdd25fb2e08c7e5274f2..875d431dec86fef4d028f63b9214963cab786820 100644 --- a/templates/ingress/ingresshost.yaml +++ b/templates/ingress/ingresshost.yaml @@ -1,4 +1,4 @@ -{{- if .Capabilities.APIVersions.Has "bcc.bd-apaas.com/v1alpha1/IngressHost" -}} +{{- if .Capabilities.APIVersions.Has "bcc.bd-apaas.com/v1alpha1" -}} --- apiVersion: bcc.bd-apaas.com/v1alpha1 kind: IngressHost diff --git a/templates/ingress/ingressroute.yaml b/templates/ingress/ingressroute.yaml index 5def218499cf618e6697213e24ea20fc3f0c67a0..f5ea7ac721ebfcb11f5f2ec74e8c568782fb7537 100644 --- a/templates/ingress/ingressroute.yaml +++ b/templates/ingress/ingressroute.yaml @@ -1,4 +1,4 @@ -{{- if .Capabilities.APIVersions.Has "bcc.bd-apaas.com/v1alpha1/IngressRoute" -}} +{{- if .Capabilities.APIVersions.Has "bcc.bd-apaas.com/v1alpha1" -}} --- apiVersion: bcc.bd-apaas.com/v1alpha1 kind: IngressRoute @@ -31,6 +31,8 @@ spec: port: {{ template "harbor.core.servicePort" . }} - match: Host(`{{ .Values.expose.ingress.hosts.core }}`) && PathPrefix(`/v2/`) kind: Rule + middlewares: + - name: "{{ template "harbor.ingress" . }}-https" services: - name: {{ template "harbor.core" . }} port: {{ template "harbor.core.servicePort" . }} diff --git a/templates/ingress/middleware.yaml b/templates/ingress/middleware.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bb742070b7c6cdd76c85ff2038f6900871bf25b7 --- /dev/null +++ b/templates/ingress/middleware.yaml @@ -0,0 +1,10 @@ +{{- if .Capabilities.APIVersions.Has "bcc.bd-apaas.com/v1alpha1" -}} +apiVersion: bcc.bd-apaas.com/v1alpha1 +kind: Middleware +metadata: + name: "{{ template "harbor.ingress" . }}-https" +spec: + headers: + customRequestHeaders: + X-Forwarded-Proto: "https" +{{- end -}} \ No newline at end of file