We trying to add http request header in the virtual service bound to ingress gateway.
Scenario-1: If we set the http header, The header was passed in http request header.
Scenario-2: If we match the host and set the header, the header was not passed in http request header.
Please validate the yaml. PFB.
If any issue please help us.
our AIM is to add a new header based on another header value (with ‘match’ condition)
Below is the Scenario-2 VS config:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: apr30-vs
namespace: apr30-test
spec:
hosts:
- ‘*’
gateways:
- apr30-gateway.istio-system.svc.cluster.local
http:
- match:
- uri:
prefix: /cDVR/
route:
- destination:
host: cdvr-ds.apr30-test.svc.cluster.local
port:
number: 8041
- match:
- uri:
prefix: /epg/
route:
- destination:
host: epg-ds.apr30-test.svc.cluster.local
port:
number: 8042
- match:
- uri:
prefix: /usage/
route:
- destination:
host: usage-data-ds.apr30-test.svc.cluster.local
port:
number: 8043
- match:
- uri:
prefix: /user/
route:
- destination:
host: user-ds.apr30-test.svc.cluster.local
port:
number: 8044
- match:
- headers:
host:
exact: ‘test.example.com:8045’
route:
- destination:
host: epg-bs.apr30-test.svc.cluster.local
port:
number: 8045
headers:
request:
add:
opco: “222”