首页 > 解决方案 > 在 Istio 中需要单独的 VirtualService 和 DestinationRule 配置

问题描述

在 Istio 中,我想知道为什么 VirtualService 和 DestinationRule 被分成两个单独的配置文件?AFAICT,DestinationRule 定义子集和 VirtualService 路由到子集。显然,他们都做的不止于此,但我的问题是,将两者分开的设计思想可能是什么。为什么我们不能在 VirtualService yaml 本身中定义子集?

一个后续问题是:为什么在目标规则中配置了断路器规则,而在 VirtualService 中配置了超时和重试?同样,我想,我无法理解这个设计决定背后的原因。如果这很清楚,则可以同时回答这两个问题。在概念上理解这一点的任何帮助将不胜感激。

标签: kubernetesistio

解决方案


They were designed to provide a clear separation of routing from post-routing behaviors.

A VirtualService is used to describe the mapping (route rules) from one or more user-addressable destinations (hosts) to the actual destination workloads (services) inside the mesh.

A DestainationRule then defines the set of policies to be applied to a request after VirtualService routing has occurred. They are intended to be authored by service owners, describing the circuit breakers, load balancer settings, TLS settings, etc.

An overview of how they work is here.


推荐阅读