<p>I recently started looking into istio and got confused by the destination rule configuration.</p>

<p>Say I have a service A that have 10 pods running behind it. I pushed a destination rule that has two subsets with label version=v1 and version=v2.</p>

<p>So I'm wondering what will happen to the 10 pods under the hood? Will they be divided into two subsets automatically or just remain unlabeled? Or the subsets will only be valid when the pods themselves are labeled with version=v1 and version=v2?</p>

<p>Thanks a lot!</p>

milodky
<p>The general purpose is to set up <code>DestinationRule</code> resource in order to specify how the network traffic will reach your underlying Kubernetes cluster Pods.
<code>Subsets</code> parameter in Istio defines labels that identify version specific instances. </p>

<p>The below example of Istio <code>DestinationRule</code> configuration demonstrates how it works and can potentially reproduce your case:</p>

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

<p>Actually, label <code>version: v1</code> indicates that only Pods in Kubernetes marked with the same label will receive network traffic; therefore the same approach will work for label <code>version: v2</code>.</p>

<p>There are several resources available in Istio that can expand functionality for network management purposes as described in <a href="https://istio.io/docs/concepts/traffic-management/rules-configuration/" rel="nofollow noreferrer">Official documentation</a>.</p>
