Files
taiji-AI-PAD/k8s/ingress.yaml
T
2025-12-28 08:33:23 +00:00

148 lines
4.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ingress 配置 - 使用 Azure Application Gateway 或 NGINX Ingress
# 根据您的 AKS 配置选择相应的 Ingress Controller
---
# 选项1: Azure Application Gateway Ingress Controller (AGIC)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: taiji-ingress
namespace: taiji-ai
annotations:
# Azure Application Gateway Ingress Controller 注解
kubernetes.io/ingress.class: azure/application-gateway
appgw.ingress.kubernetes.io/ssl-redirect: "true"
appgw.ingress.kubernetes.io/connection-draining: "true"
appgw.ingress.kubernetes.io/connection-draining-timeout: "30"
appgw.ingress.kubernetes.io/backend-protocol: "http"
appgw.ingress.kubernetes.io/request-timeout: "300"
appgw.ingress.kubernetes.io/health-probe-path: "/health"
appgw.ingress.kubernetes.io/health-probe-interval: "30"
appgw.ingress.kubernetes.io/health-probe-timeout: "10"
appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "3"
# CORS 配置
appgw.ingress.kubernetes.io/cors-allow-origin: "*"
appgw.ingress.kubernetes.io/cors-allow-methods: "GET,POST,PUT,DELETE,OPTIONS"
appgw.ingress.kubernetes.io/cors-allow-headers: "*"
# 证书配置(使用 Azure Key Vault)
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- api.taiji-ai.com
- gateway.taiji-ai.com
secretName: taiji-tls-cert
rules:
# MCP Server API
- host: api.taiji-ai.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: mcp-server
port:
number: 8000
- path: /health
pathType: Exact
backend:
service:
name: mcp-server
port:
number: 8000
- path: /docs
pathType: Prefix
backend:
service:
name: mcp-server
port:
number: 8000
- path: /openapi.json
pathType: Exact
backend:
service:
name: mcp-server
port:
number: 8000
# Data Ingestion API
- host: api.taiji-ai.com
http:
paths:
- path: /ingestion
pathType: Prefix
backend:
service:
name: data-ingestion
port:
number: 8000
# Model Gateway (内部使用,可选暴露)
- host: gateway.taiji-ai.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: litellm-gateway
port:
number: 4000
---
# 选项2: NGINX Ingress Controller (如果使用 NGINX 而不是 AGIC)
# 取消注释以下配置,并注释掉上面的 AGIC 配置
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: taiji-ingress-nginx
# namespace: taiji-ai
# annotations:
# kubernetes.io/ingress.class: nginx
# cert-manager.io/cluster-issuer: letsencrypt-prod
# nginx.ingress.kubernetes.io/ssl-redirect: "true"
# nginx.ingress.kubernetes.io/proxy-body-size: "50m"
# nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
# nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
# nginx.ingress.kubernetes.io/cors-allow-origin: "*"
# nginx.ingress.kubernetes.io/cors-allow-methods: "GET,POST,PUT,DELETE,OPTIONS"
# nginx.ingress.kubernetes.io/cors-allow-headers: "*"
# spec:
# tls:
# - hosts:
# - api.taiji-ai.com
# - gateway.taiji-ai.com
# secretName: taiji-tls-cert
# rules:
# - host: api.taiji-ai.com
# http:
# paths:
# - path: /api
# pathType: Prefix
# backend:
# service:
# name: mcp-server
# port:
# number: 8000
# - path: /ingestion
# pathType: Prefix
# backend:
# service:
# name: data-ingestion
# port:
# number: 8000
# - host: gateway.taiji-ai.com
# http:
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: litellm-gateway
# port:
# number: 4000