
apiVersion: apps/v1kind: Deploymentmetadata:name: product-v2namespace: baselabels:app: productversion: v2spec:replicas: 1selector:matchLabels:app: productversion: v2template:metadata:labels:app: productversion: v2spec:containers:- name: productimage: ccr.ccs.tencentyun.com/zhulei/testproduct2:v1imagePullPolicy: Alwaysenv:- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: REGIONvalue: "guangzhou-zoneA"ports:- containerPort: 7000
VirtualService. Route 50% of the traffic to the product v2 subset for verification and the other 50% to product v1. This can be configured by submitting the following YAML file to the primary cluster.apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: product-vsnamespace: basespec:hosts:- "product.base.svc.cluster.local"http:- match:- uri:exact: /productroute:- destination:host: product.base.svc.cluster.localsubset: v1port:number: 7000weight: 50- destination:host: product.base.svc.cluster.localsubset: v2port:number: 7000weight: 50---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: productnamespace: basespec:host: productsubsets:- name: v1labels:version: v1- name: v2labels:version: v2


VirtualService. Set to route all the traffic (100%) to the product service to product v2 and refresh the product list page for verification. The weight is adjusted based on VirtualService as shown below:


Feedback