# 腾讯云 TKE 专用 Ingress 模板 # # 与通用 ingress.yaml 的区别: # 通用用 nginx/alb class → TKE 不支持 # TKE 用 ingressClassName: qcloud,且后端 Service 必须是 NodePort 类型 # # 使用前: # 1) 先创建 NodePort Service:kubectl apply -f kubernetes/service-nodeport.yaml # 2) 把下面 host 改成你要用的域名 # 3) kubectl apply -f kubernetes/examples/ingress-tke.yaml # 4) 在腾讯云控制台/DNS 把该域名解析到 CLB 的公网 IP apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: opsxsql namespace: sql annotations: cloud.tencent.com/health-check-path: /health cloud.tencent.com/health-check-interval: "10" spec: ingressClassName: qcloud rules: - host: opsxsql.example.com # ← 改成你的域名 http: paths: - path: / pathType: Prefix backend: service: name: opsxsql-nodeport port: number: 80