1 Knative Service handling traffic for multiple virtual hosts

373 views
Skip to first unread message

Alex

unread,
Feb 24, 2021, 5:15:12 PM2/24/21
to Knative Users
Hey folks,

I have 2 services: one that handles account concerns and another that does other stuff.

I would like for the account service to handle traffic for a requests on the /account path for a number of domains: i.e. {aaa,bbb,ccc}.com/account

I have created other istio VirtualService as below but it's not working as it rewrites the authority (host+path) so the actual service never knows the original Host header of the request.

Do you have any ideas on how to handle this case?

kind: VirtualService
metadata:
name: account-route
spec:
gateways:
- knative-serving/knative-ingress-gateway
hosts:
- "*.aaa.com"
http:
- match:
- uri:
exact: "/account"
rewrite:
route:
- destination:
host: knative-local-gateway.istio-system.svc.cluster.local
weight: 100

Many thanks in advance!

Carlos Santana

unread,
Feb 24, 2021, 8:55:53 PM2/24/21
to Alex, Knative Users
Hi Alex

The website has a servicing sample that illustrate your use case on sharing a single hostname and route based on path to different Knative services. 

Take a look here  https://knative.dev/docs/serving/samples/knative-routing-go/index.html  and let us know  if it covers what your looking for 

Carlos Santana
——————————————
IBM Senior Technical Staff Member (STSM) 
Twitter @csantanapr
Time Zone GMT-5

On Feb 24, 2021, at 5:15 PM, 'Alex' via Knative Users <knativ...@googlegroups.com> wrote:


--
You received this message because you are subscribed to the Google Groups "Knative Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knative-users/58675823-ee56-463f-aa11-47d3e6154371n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages