I am new to istio and I think I misunderstood something.
And I am using version 1.2.5 and had created a Gateway, VirtualService, and a DestinationRule with two subsets sending traffic to two versions of my service.
From the outside (traffic coming from outside Kubernetes) it is working pretty well. I am seeing traffic on the two versions of my service.
By when traffic comes from a service inside Kubernetes (ex: another service on the k8s) none of
VirtualService or DestinationRule seems to work. I am only seeing traffic on just one version of my service.
The scenario:
Internet -> IstioGateway -> VirtualService -> DestinationRule ---> Service_A_version_v1
|---> Service_A_version_v2
Service_B( with envoy) -> service_a.service_a-ns.svc.cluster.local --> Service_A_version_v1 (DestinationRule does not work)
If I understand correctly (and also configure correctly) DestinationRule from inside (mesh) should send traffic to the two versions, right?)
What I am doing wrong?
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-gateway
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*.mydomain.io"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-service-a
namespace: my-service-a-ns
spec:
hosts:
- "*.mydomain.io"
- my-service-a.my-service-a-ns.svc.cluster.local
gateways:
- istio-gateway.istio-system.svc.cluster.local
http:
- match:
- uri:
prefix: "/my-service-a"
rewrite:
uri: /
route:
- destination:
host: my-service-a.my-service-a-ns.svc.cluster.local
port:
number: 8080
subset: v1
weight: 50
- destination:
host: my-service-a.my-service-a-ns.svc.cluster.local
port:
number: 8080
subset: v2
weight: 50
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: my-service-a
namespace: my-service-a-ns
spec:
host: my-service-a.my-service-a-ns.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2