Hi, I have two services, hello-world and service1, in two different namespaces, default and service1. My hello-world service is deployed in the default namespace and my service1 service is deployed in the service1 namespace with the label version:v1 and another one with label version:v2. I have also checked that the Envoy sidecar has been injected into my pods.
In my hello-world app, I am sending a GET request to http://service1.service1
I’m using Istio 1.12.10 on GKE.
virtual_service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: service1-vs
namespace: service1
spec:
hosts:
- service1 # interpreted as service1.service1.svc.cluster.local
http:
- route:
- destination:
host: service1 # interpreted as service1.service1.svc.cluster.local
subset: v1
weight: 90
- destination:
host: service1 # interpreted as service1.service1.svc.cluster.local
subset: v2
weight: 10
destination_rule.yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: service1-destination-rule
namespace: service1
spec:
host: service1
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
After running kubectl apply -f, I’m still receiving 50-50 traffic.
Not sure if it matters, but I’m using a Load Balancer to receive traffic on hello-world.