gitdataai/deploy/templates/ingress.yaml
ZhenYi 6c3f5b49f8 feat(deploy): single unified Ingress with per-host routing
Replace multiple conflicting Ingress resources with one that routes:
- gitdata.ai         → frontend (port 80)
- api.gitdata.ai     → app (port 8080)
- git.gitdata.ai     → gitserver-http (port 8022)
- static.gitdata.ai  → static (port 8081)

Disable service-level ingress configs in values.yaml (they would
conflict on the same host/path). Single TLS secret covers all hosts.
2026-04-15 14:17:03 +08:00

71 lines
1.9 KiB
YAML

{{- /* Single unified Ingress for all services */ -}}
{{- $fullName := include "gitdata.fullname" . -}}
{{- $ns := include "gitdata.namespace" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-ingress
namespace: {{ $ns }}
labels:
app.kubernetes.io/name: {{ $fullName }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
cert-manager.io/cluster-issuer: cloudflare-acme-cluster-issuer
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
spec:
ingressClassName: nginx
tls:
- hosts:
- gitdata.ai
- api.gitdata.ai
- git.gitdata.ai
- static.gitdata.ai
secretName: {{ $fullName }}-tls
rules:
# Frontend
- host: gitdata.ai
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-frontend
port:
number: 80
# API
- host: api.gitdata.ai
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-app
port:
number: {{ .Values.app.service.port }}
# Gitserver HTTP
- host: git.gitdata.ai
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-gitserver-http
port:
number: {{ .Values.gitserver.service.http.port }}
# Static files
- host: static.gitdata.ai
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}-static
port:
number: {{ .Values.static.service.port }}