What happens when a destinationrule is pushed in istio
I recently started looking into istio and got confused by the destination rule configuration.
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.
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?
Thanks a lot!
The general purpose is to set up
DestinationRuleresource in order to specify how the network traffic will reach your underlying Kubernetes cluster Pods.
Subsetsparameter in Istio defines labels that identify version specific instances.
The below example of Istio
DestinationRuleconfiguration demonstrates how it works and can potentially reproduce your case:
apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: reviews spec: host: reviews subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2
version: v1indicates that only Pods in Kubernetes marked with the same label will receive network traffic; therefore the same approach will work for label
There are several resources available in Istio that can expand functionality for network management purposes as described in Official documentation.