Expose Legacy REST API using ISTIO


I need your generous advices for a situation i am facing.

I have a legacy REST API that is deployed in a VM, and i need to expose it’s functions using istio.
I know that we can expand istio to VMs but for the being time it’s not targeted in our working roadmap.

Should i develop a new REST API to put on the mesh, and that will at the same time consume and expose the legacy REST API to outside the enterprise ? or is there another efficient/convenient solution ?

Thank you in advance,

Hi, good question! Just to clarify: the API is running on a VM outside of Istio, but you want to use Istio to expose the REST endpoints? Is this so that clients inside your Istio mesh (in Kubernetes) can consume this API? Or to provide consistency between APIs running in Istio, and this API which is outside?

If it’s the second case, I would recommend doing what you suggested – creating a passthrough service running in Kubernetes, with Istio, that forwards API requests to the legacy service.
Then you can expose the passthrough service with Istio gateways/virtualservices.

But creating this passthrough service will add at least 2 network hops for every API call – one for the passthrough service’s sidecar proxy, and one for the passthrough service itself. So this would add latency to every call to that VM’s REST API.

If you are unable to do Mesh Expansion for the VM right now, I think this might be the only option for exposing the VM’s API with Istio.

Thank you for your answer, just to confirm please, here is a small schema

The clients that are supposed to consume the API are not only inside the mesh but also outside the enterprise, it’s a form of monitoring the going on traffic, between “Outside caller” and the “Legacy Rest API” via Istio Service Mesh.

you may create a ServiceEntry in your mesh which points to your legacy REST service, outside consumer can invoke the service via IngressGateway with host:port (the host is specified in the serviceentry, destination is the serviceentry name).

Thank you Jeff. I’ll give it a try and give you feedback.