Added web and kratos redirect

This commit is contained in:
Mart van Santen 2022-03-22 17:51:37 +08:00
parent 24bdcd14e0
commit 307c4ebb24

View file

@ -19,6 +19,7 @@ metadata:
kubernetes.io/tls-acme: "true" kubernetes.io/tls-acme: "true"
{{- end }} {{- end }}
{{- end }} {{- end }}
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec: spec:
{{- if or .Values.ingress.tls .Values.ingress.extraTls }} {{- if or .Values.ingress.tls .Values.ingress.extraTls }}
tls: tls:
@ -36,28 +37,43 @@ spec:
- host: {{ .Values.ingress.hostname }} - host: {{ .Values.ingress.hostname }}
http: http:
paths: paths:
- path: {{ .Values.ingress.path }} - path: ({{ .Values.ingress.path }}.*)
{{- if eq "true" (include "common.ingress.supportsPathType" .) }} {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }} pathType: {{ .Values.ingress.pathType }}
{{- end }} {{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" .) "servicePort" "dashboard-http" "context" $) | nindent 14 }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" .) "servicePort" "dashboard-http" "context" $) | nindent 14 }}
# Forward API calls to the back-end container # Forward API calls to the back-end container
- path: {{ .Values.ingress.path }}api/v1 - path: ({{ .Values.ingress.path }}api/v1.*)
{{- if eq "true" (include "common.ingress.supportsPathType" .) }} {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }} pathType: {{ .Values.ingress.pathType }}
{{- end }} {{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "backend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "backend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }}
- path: ({{ .Values.ingress.path }}web.*)
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "backend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }}
- path: {{ .Values.ingress.path }}kratos/(.*)
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "single-sign-on.fullname" .)-kratos-public "servicePort" "80" "context" $) | nindent 14 }}
{{- end }} {{- end }}
{{- range .Values.ingress.extraHosts }} {{- range .Values.ingress.extraHosts }}
- host: {{ .name }} - host: {{ .name }}
http: http:
paths: paths:
- path: {{ default "/" .path }} - path: ({{ default "/" .path }}.*)
{{- if eq "true" (include "common.ingress.supportsPathType" $) }} {{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }} pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }} {{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" $) "servicePort" "dashboard-http" "context" $) | nindent 14 }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" $) "servicePort" "dashboard-http" "context" $) | nindent 14 }}
- path: {{ default "/" .path }}api/v1 - path: ({{ default "/" .path }}api/v1.*)
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "backend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }}
- path: ({{ default "/" .path }}web.*)
{{- if eq "true" (include "common.ingress.supportsPathType" $) }} {{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }} pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }} {{- end }}