From 5d5455ac50c3603f6d08dbc8c7993a5a0b14f3af Mon Sep 17 00:00:00 2001 From: shucheng Date: Thu, 21 Jan 2021 23:47:16 +0800 Subject: [PATCH] update --- templates/ingress/ingresshost.yaml | 2 +- templates/ingress/ingressroute.yaml | 4 +++- templates/ingress/middleware.yaml | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 templates/ingress/middleware.yaml diff --git a/templates/ingress/ingresshost.yaml b/templates/ingress/ingresshost.yaml index 9c77585..875d431 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 5def218..f5ea7ac 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 0000000..bb74207 --- /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 -- 2.26.0