be2587dcf5
Build hosts as <userPrefix>-<deploymentNumber>-preview.<rootDomain> from FRONTEND_URL, wire them through ingress/TLS, and open them from the preview API. Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
{{- if .Values.ingress.enabled }}
|
|
{{- $name := include "cloudhost-app.name" . -}}
|
|
{{- $ns := include "cloudhost-app.namespace" . -}}
|
|
{{- $host := printf "%s.%s" (default $name .Values.ingress.subdomain) .Values.ingress.domain -}}
|
|
{{- $previewHost := .Values.ingress.previewHost | default "" -}}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ $name }}
|
|
namespace: {{ $ns }}
|
|
labels:
|
|
{{- include "cloudhost-app.labels" . | nindent 4 }}
|
|
annotations:
|
|
cert-manager.io/cluster-issuer: {{ .Values.ingress.clusterIssuer | quote }}
|
|
spec:
|
|
ingressClassName: nginx
|
|
rules:
|
|
- host: {{ $host }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ $name }}
|
|
port:
|
|
number: 80
|
|
{{- if .Values.ingress.customDomain }}
|
|
- host: {{ .Values.ingress.customDomain }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ $name }}
|
|
port:
|
|
number: 80
|
|
{{- end }}
|
|
{{- if $previewHost }}
|
|
- host: {{ $previewHost }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ $name }}
|
|
port:
|
|
number: 80
|
|
{{- end }}
|
|
tls:
|
|
- hosts:
|
|
- {{ $host }}
|
|
{{- if .Values.ingress.customDomain }}
|
|
- {{ .Values.ingress.customDomain }}
|
|
{{- end }}
|
|
{{- if $previewHost }}
|
|
- {{ $previewHost }}
|
|
{{- end }}
|
|
secretName: {{ $name }}-tls
|
|
{{- end }}
|