95d0b162c5
Separate the marketing landing site from the authenticated app by host. Next.js middleware reads PANEL_HOST/LANDING_HOST at runtime and redirects authenticated routes (/dashboard, /login, /register) from the landing host to the panel host, and the landing root on the panel host to /dashboard. Disabled (single-origin) when PANEL_HOST is unset, so local dev is unchanged. Helm: add ingress.panel.host with a third ingress rule + TLS host routing to the frontend service, pass LANDING_HOST/PANEL_HOST to the frontend, and append the panel origin to the backend CORS list (frontend URL stays first so PLATFORM_DOMAIN resolution is unaffected). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
89 lines
2.8 KiB
YAML
89 lines
2.8 KiB
YAML
{{- if .Values.ingress.enabled }}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ include "cloudhost-platform.fullname" . }}
|
|
namespace: {{ include "cloudhost-platform.namespace" . }}
|
|
labels:
|
|
{{- include "cloudhost-platform.labels" . | nindent 4 }}
|
|
annotations:
|
|
{{- if .Values.ingress.tls.enabled }}
|
|
cert-manager.io/cluster-issuer: {{ .Values.ingress.tls.clusterIssuer | quote }}
|
|
{{- end }}
|
|
{{- if and .Values.ingress.singleHost.enabled .Values.ingress.singleHost.apiPath }}
|
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
|
{{- end }}
|
|
{{- with .Values.ingress.annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
ingressClassName: {{ .Values.ingress.className }}
|
|
{{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
- hosts:
|
|
{{- if .Values.ingress.singleHost.enabled }}
|
|
- {{ .Values.ingress.singleHost.host | quote }}
|
|
{{- else }}
|
|
- {{ .Values.ingress.frontend.host | quote }}
|
|
{{- if .Values.ingress.panel.host }}
|
|
- {{ .Values.ingress.panel.host | quote }}
|
|
{{- end }}
|
|
- {{ .Values.ingress.api.host | quote }}
|
|
{{- end }}
|
|
secretName: {{ include "cloudhost-platform.tlsSecretName" . }}
|
|
{{- end }}
|
|
rules:
|
|
{{- if .Values.ingress.singleHost.enabled }}
|
|
- host: {{ .Values.ingress.singleHost.host | quote }}
|
|
http:
|
|
paths:
|
|
- path: {{ .Values.ingress.singleHost.apiPath }}
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "cloudhost-platform.backend.fullname" . }}
|
|
port:
|
|
number: 4000
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "cloudhost-platform.frontend.fullname" . }}
|
|
port:
|
|
number: 3000
|
|
{{- else }}
|
|
- host: {{ .Values.ingress.frontend.host | quote }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "cloudhost-platform.frontend.fullname" . }}
|
|
port:
|
|
number: 3000
|
|
{{- if .Values.ingress.panel.host }}
|
|
- host: {{ .Values.ingress.panel.host | quote }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "cloudhost-platform.frontend.fullname" . }}
|
|
port:
|
|
number: 3000
|
|
{{- end }}
|
|
- host: {{ .Values.ingress.api.host | quote }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "cloudhost-platform.backend.fullname" . }}
|
|
port:
|
|
number: 4000
|
|
{{- end }}
|
|
{{- end }}
|