|
|
@ -1,6 +1,7 @@ |
|
|
|
{{- if .Values.ingress.enabled -}} |
|
|
|
{{- $fullName := include "portalmodelo.fullname" . -}} |
|
|
|
{{- $hostName := .Values.portal.hostname -}} |
|
|
|
{{- $hostPrefix := .Values.portal.hostprefix -}} |
|
|
|
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} |
|
|
|
apiVersion: networking.k8s.io/v1beta1 |
|
|
|
{{- else -}} |
|
|
@ -18,7 +19,7 @@ metadata: |
|
|
|
cert-manager.io/cluster-issuer: "letsencrypt-prod" |
|
|
|
{{- end }} |
|
|
|
{{- if contains "nginx" .Values.ingress.class }} |
|
|
|
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/www.{{ $hostName }}:443/portal/VirtualHostRoot/$1" |
|
|
|
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/{{ $hostPrefix }}.{{ $hostName }}:443/portal/VirtualHostRoot/$1" |
|
|
|
nginx.ingress.kubernetes.io/from-to-www-redirect: "true" |
|
|
|
{{- end }} |
|
|
|
{{- if contains "alb" .Values.ingress.class }} |
|
|
@ -27,7 +28,7 @@ metadata: |
|
|
|
{{- else }} |
|
|
|
# DO NOT USE TLS |
|
|
|
{{- if contains "nginx" .Values.ingress.class }} |
|
|
|
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/http/www.{{ $hostName }}:80/portal/VirtualHostRoot/$1" |
|
|
|
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/http/{{ $hostPrefix }}.{{ $hostName }}:80/portal/VirtualHostRoot/$1" |
|
|
|
{{- end }} |
|
|
|
{{- if contains "alb" .Values.ingress.class }} |
|
|
|
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]' |
|
|
@ -43,12 +44,12 @@ spec: |
|
|
|
{{- if .Values.ingress.tls.enabled }} |
|
|
|
tls: |
|
|
|
- hosts: |
|
|
|
- "www.{{ $hostName }}" |
|
|
|
- "{{ $hostPrefix }}.{{ $hostName }}" |
|
|
|
- "{{ $hostName }}" |
|
|
|
secretName: {{ $hostName | replace "." "-" }}-tls |
|
|
|
{{- end }} |
|
|
|
rules: |
|
|
|
- host: "www.{{ $hostName }}" |
|
|
|
- host: "{{ $hostPrefix }}.{{ $hostName }}" |
|
|
|
http: |
|
|
|
paths: |
|
|
|
{{- if contains "nginx" .Values.ingress.class }} |
|
|
|