<p>I have a confusion between Virtual Service and Destinationrule on which one is executed first?
Let’s say I have below configs,</p>

<p>Destinationrule -</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: movies
  namespace: aio
spec:
  host: movies
  subsets:
  - labels:
      version: v1
    name: version-v1
  - labels:
      version: v2
    name: version-v2
---
</code></pre>

<p>VirtualService</p>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: movies
  namespace: aio
spec:
  hosts:
  - movies
  http:
  - route:
    - destination:
        host: movies
        subset: version-v1
      weight: 10
    - destination:
        host: movies
        subset: version-v2
      weight: 90
---
</code></pre>

<p>I read somewhere that,
A VirtualService defines a set of traffic <strong>routing rules</strong> to apply when a host is addressed.
DestinationRule defines policies that apply to traffic intended for service <strong>after routing has occurred.</strong>
Does this mean Destinationrules are invoked after Virtualservices?</p>

<p>I have a small diagram, is my understanding correct?</p>

<p><a href="https://i.stack.imgur.com/1DlGg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1DlGg.png" alt="enter image description here"></a></p>

<p>Yes,</p>

<p>According to <a href="https://istio.io/docs/reference/config/networking/destination-rule/" rel="nofollow noreferrer">istio</a> documentation about <code>DestinationRule</code>:</p>

<blockquote>
  <p>DestinationRule defines policies that apply to traffic intended for a service after routing has occurred.</p>
</blockquote>

<p>And for <a href="https://istio.io/docs/reference/config/networking/virtual-service/" rel="nofollow noreferrer"><code>VirtualService</code></a>:</p>

<blockquote>
  <p>A VirtualService defines a set of traffic routing rules to apply when a host is addressed.</p>
</blockquote>

<p>There is an youtube video: <a href="https://www.youtube.com/watch?v=oZrZlx2fmcM" rel="nofollow noreferrer">Life of a Packet through Istio</a> it explains in detail the order of processes that are applied to a packet going through the istio mesh. </p>
