权重路由

基于用户自定权重实现路由功能。

  1. apiVersion: service.dubbo.apache.org/v1alpha1
  2. kind: VirtualService
  3. metadata:
  4. name: reviews-route
  5. spec:
  6. hosts:
  7. - reviews.prod.svc.cluster.local
  8. dubbo:
  9. - name: weightRoute
  10. routedetail:
  11. - name: weght
  12. route:
  13. - destination:
  14. host: reviews.prod.svc.cluster.local
  15. subset: v1
  16. weight: 60
  17. - destination:
  18. host: reviews.prod.svc.cluster.local
  19. subset: v2
  20. weight: 40
  21. ---
  22. apiVersion: service.dubbo.apache.org/v1alpha1
  23. kind: DestinationRule
  24. metadata:
  25. name: reviews-route
  26. spec:
  27. host: reviews.prod.svc.cluster.local
  28. subsets:
  29. - name: v1
  30. labels:
  31. version: v1
  32. - name: v2
  33. labels:
  34. version: v2