Doubts about using service/route defination

Say we have a service which serves at http://my-business-server:8080/business

In the past, under api-defination style, we could define such three api:

  1. /business -> http://my-business-server:8080 (strip url == false)
  2. /hide/client -> http://my-business-server:8080/business/client/r0 (strip url == true)
  3. /hide/media-> http://my-business-server:8080/business/media/r0 (strip url == true)

the 2. 3. mainly for hiding the word ‘business’ in url-path from our client.

Now we are moving the configuration to service/route style. But it seems that I cannot use just one service object with three route object to acheve the three forwarding rules above.

Is there a solution?

p.s. Why I do i expect using just one service defination. In my understanding the new Service/Route model is suit for SOA governance/service mesh, which treats ‘service’ as granularity and base unit. I hope the service defination could be neat(without define redundancy), and such there’s only one label (service=‘business’) in prometheus metrics, and only one (service=‘business’) in zipkin UI and so on.

Thank you for sharing your concern. I don’t have a solution right now, but I think we can do something about it. Do you have anything to share on how you would like to fix this issue (I think there are many ways to tackle it)?

In my opinion, the main reason is the separation between strip-url in route-obj and upsteam-url-perfix in service-obj is insufficient in modeling. Maybe we can put both strip-url and upstream-perfix(optional default as “”) into route model and keep service’s url stay on protocol-domain-port as a solution.

Currently I would like to add some extra api-obj definations(to fit 2.3) as a workaround.