ingress-gateway-canary.example.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # �?Ingress:backend 指向 stable Service gateway
  2. # 灰度:另�?Ingress 或使用同 host �?canary 注解指向 gateway-canary(二选一,此处为「独�?canary Ingress」示例)
  3. ---
  4. apiVersion: networking.k8s.io/v1
  5. kind: Ingress
  6. metadata:
  7. name: gateway
  8. namespace: alien-produ
  9. annotations:
  10. kubernetes.io/ingress.class: nginx
  11. spec:
  12. rules:
  13. - host: api-produ.example.com
  14. http:
  15. paths:
  16. - path: /
  17. pathType: Prefix
  18. backend:
  19. service:
  20. name: gateway
  21. port:
  22. number: 8000
  23. ---
  24. apiVersion: networking.k8s.io/v1
  25. kind: Ingress
  26. metadata:
  27. name: gateway-canary
  28. namespace: alien-produ
  29. annotations:
  30. kubernetes.io/ingress.class: nginx
  31. nginx.ingress.kubernetes.io/canary: "true"
  32. nginx.ingress.kubernetes.io/canary-weight: "0"
  33. # 与主 Ingress 相同 host,Nginx 按权重分流到�?Ingress �?backend
  34. spec:
  35. rules:
  36. - host: api-produ.example.com
  37. http:
  38. paths:
  39. - path: /
  40. pathType: Prefix
  41. backend:
  42. service:
  43. name: gateway-canary
  44. port:
  45. number: 8000