Files
cloud-host/backend/helm/cloudhost-platform/templates/frontend-deployment.yaml
T
keyhan 95d0b162c5 feat(panel): serve authenticated app on dedicated panel subdomain
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>
2026-06-16 17:33:19 +03:30

56 lines
1.8 KiB
YAML

{{- if .Values.frontend.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cloudhost-platform.frontend.fullname" . }}
namespace: {{ include "cloudhost-platform.namespace" . }}
labels:
app: {{ include "cloudhost-platform.frontend.fullname" . }}
{{- include "cloudhost-platform.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.frontend.replicas }}
selector:
matchLabels:
app: {{ include "cloudhost-platform.frontend.fullname" . }}
template:
metadata:
labels:
app: {{ include "cloudhost-platform.frontend.fullname" . }}
spec:
containers:
- name: frontend
image: {{ include "cloudhost-platform.frontendImage" . | quote }}
imagePullPolicy: {{ .Values.images.frontend.pullPolicy }}
ports:
- containerPort: 3000
env:
- name: PORT
value: "3000"
- name: HOSTNAME
value: "0.0.0.0"
{{- if .Values.ingress.panel.host }}
# Host-based separation: landing on frontend.host, authenticated
# panel on panel.host. Read by Next.js middleware at runtime.
- name: LANDING_HOST
value: {{ .Values.ingress.frontend.host | quote }}
- name: PANEL_HOST
value: {{ .Values.ingress.panel.host | quote }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 15
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 10
periodSeconds: 10
{{- with .Values.frontend.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}