Files
todo-frontend/k8s/ingress.yaml
Agent 1e820fa0ca
All checks were successful
continuous-integration/drone/push Build is passing
feat: Ingress配置/api转发到后端
2026-03-24 15:24:47 +00:00

34 lines
808 B
YAML

# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sales-ingress
namespace: drone
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
tls:
- hosts:
- sales.violin-work.online
secretName: violin-tls
rules:
- host: sales.violin-work.online
http:
paths:
# /api 路径转发到后端服务
- path: /api
pathType: Prefix
backend:
service:
name: todo-backend
port:
number: 80
# 其他路径转发到前端服务
- path: /
pathType: Prefix
backend:
service:
name: todo-frontend
port:
number: 80